summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* vo_gpu: vulkan: Add arbitrary user data for an ra_vk_bufPhilip Langdale2018-10-222-0/+18
| | | | | | | | | This is arguably a little contrived, but in the case of CUDA interop, we have to track additional state on the cuda side for each exported buffer. If we want to be able to manage buffers with an ra_buf_pool, we need some way to keep that CUDA state associated with each created buffer. The easiest way to do that is to attach it directly to the buffers.
* vo_gpu: vulkan: Add support for exporting buffer memoryPhilip Langdale2018-10-228-6/+179
| | | | | | | | | | | | | | | | | | | | The CUDA/Vulkan interop works on the basis of memory being exported from Vulkan and then imported by CUDA. To enable this, we add a way to declare a buffer as being intended for export, and then add a function to do the export. For now, we support the fd and Handle based exports on Linux and Windows respectively. There are others, which we can support when a need arises. Also note that this is just for exporting buffers, rather than textures (VkImages). Image import on the CUDA side is supposed to work, but it is currently buggy and waiting for a new driver release. Finally, at least with my nvidia hardware and drivers, everything seems to work even if we don't initialise the buffer with the right exportability options. Nevertheless I'm enforcing it so that we're following the spec.
* build: more reliable way of getting the Swift version from a stringAkemi2018-10-221-1/+4
| | | | Fixes #6212
* vo_gpu: vulkan: suppress bogus error message on --vulkan-deviceNiklas Haas2018-10-211-5/+5
| | | | | | Since the code just broke out of the loop on a match rather than jumping straight to the end of the function body, it ended up hitting the code path for when the end of the list was reached.
* cocoa-cb: fix double clicking the title barAkemi2018-10-211-1/+29
| | | | | | | | | since we draw our own title bar we lose the standard functionality of the system provided title bar. because of that we have to reimplement the functionality of double clicking the title bar. depending on the system preferences we want to minimize, zoom or do nothing. Fixes #6223
* vo_gpu: vulkan: fix strncpy truncation in spirv_compiler_initBtbN2018-10-211-1/+1
| | | | | | Fixes GCC8 warning ../video/out/gpu/spirv.c: In function 'spirv_compiler_init': ../video/out/gpu/spirv.c:68:9: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation]
* x11: fix icc profile when the window goes near off screenslatchurie2018-10-211-1/+1
| | | | | | | | On a multi monitor setup, when the center of the window was going off screen, the icc profile would always switch to the profile of the first screen. This fixes the issue by defaulting the value to the current screen.
* vo_gpu: vulkan: fix the buffer size on partial uploadNiklas Haas2018-10-191-0/+1
| | | | | | | | | | | This was pased on the texture height, which was a mistake. In some cases it could exceed the actual size of the buffer, leading to a vulkan API error. This didn't seem to cause any problems in practice, since a too-large synchronization is just bad for performance and shouldn't do any harm internally, but either way, it was still undefined behavior to submit a barrier outside of the buffer size. Fix the calculation, thus fixing this issue.
* vo_gpu: split --linear-scaling into two separate optionsNiklas Haas2018-10-195-31/+58
| | | | | | | | | | | | | | | | | | Since linear downscaling makes sense to handle independently from linear/sigmoid upscaling, we split this option up. Now, linear-downscaling is its own option that only controls linearization when downscaling and nothing more. Likewise, linear-upscaling / sigmoid-upscaling are two mutually exclusive options (the latter overriding the former) that apply only to upscaling and no longer implicitly enable linear light downscaling as well. The old behavior was very confusing, as evidenced by issues such as #6213. The current behavior should make much more sense, and only minimally breaks backwards compatibility (since using linear-scaling directly was very uncommon - most users got this for free as part of gpu-hq and relied only on that). Closes #6213.
* x11_common: replace atoi with strtoulNicolas F2018-10-191-1/+2
| | | | | | Using strtol and strtoul is allegedly better practice, and I'm going for strtoul here because I'm pretty sure X11 displays cannot be in the negative.
* vo_gpu: opengl: fix segfault when gl->DeleteSync is unavailableNiklas Haas2018-10-161-1/+3
| | | | | | | This deinit code was never checked, so this line would always crash on implementations without support for sync objects. Fixes #6197.
* man: mention stats in interactive controlNicolas F2018-10-141-0/+5
| | | | | | | Someone on IRC pointed out that the default stats bindings weren't documented in the interactive control section of the manual, so let's add them with a short mention and a reference to the STATS section of the manual.
* cocoa-cb: fix side by side Split ViewAkemi2018-10-021-1/+1
| | | | | | | | | | when entering a Split View a windowDidEnterFullScreen event happens without a previous toggleFullScreen call. in that case it tries to stop an animation that was never initiated by us and basically breaks the system initiated fullscreen, or in this case the Split View. immediately after entering the fullscreen it tries top stop the animation and resizes the window, which causes the window to exit fullscreen. only try to stop an animation that was initiated by us and is safe to stop.
* {mac,cocoa}: trim trailing null out of macosx_icon when loading itRodger Combs2018-10-022-2/+5
| | | | | | This prevents crashes when loading the application icon image. Suggested-by: Akemi <der.richter@gmx.de>
* mac: fix crash if we can't get an event tapRodger Combs2018-10-021-9/+12
| | | | | | | | without assistive-device permissions the event tap can't be create on 10.14 any more which lead to an assertion. System Preferences > Security & Privacy > Privacy > Accessibility and add mpv or your terminal App to the list.
* encode: simplify encode_lavc_add_packetJan Ekström2018-10-011-2/+0
| | | | | We're doing the same thing as the primary path - just that we log and set 'failed' to true.
* encode: fix AVPacket deinitialization logicNiklas Haas2018-10-011-3/+4
| | | | | | | | | | | Since this function is called with packets on the stack, trying to free them makes no sense. Instead, it should unref (which is what `av_interleaved_write_frame` does anyway, rather than freeing). Also, the calling code tried unreffing the packet a second time, even after it was "freed" by the callee in the failure case - and after ownership was taken over by `av_interleaved_write_frame` in the successful case. Both of these cases were wrong.
* stats: show file formatwm42018-10-011-0/+2
| | | | Useful in particular with ytdl, where you never know what you get.
* demux_lavf: hack-fix EDL mp4 DASH hackwm42018-10-011-0/+4
| | | | | | | | | | | | | | I encountered a stream that fails with "Could not demux init fragment.". It turns out this is a regression from the recent change to that code. The assumption was that demux_lavf.c would treat this as concatenated stream - which it does, but not for probing. Doing this transparently is hard without doing it properly. Doing it properly would mean creating some sort of stream_concat (reminiscent of that FFmpeg security bug). I probably don't want to go there, and I think libavformat should just support this directly, so whatever. Hack-fix this with the knowledge that the init segment will always contain the headers.
* stream_libarchive: fix hangs when demuxer does out of bound seekswm42018-10-011-2/+9
| | | | | | | | | | | | | This happened with a .flac file inside an archive. It tried to seek beyond the end of the archive entry in a format where seeking isn't supported. stream_libarchive handles these situations by skipping data. But when the end of the archive is reached, archive_read_data() returns 0. While libarchive didn't bother to fucking document this, they do say it's supposed to work like read(), so I guess a return value of 0 really means EOF. So change the "< 0" to "<= 0". Also add some error logging. The same file actually worked without out of bounds reads when extracted, so there still might be something very wrong.
* rendezvous: fix a typowm42018-10-011-1/+1
|
* demux: allow cache sizes > 2GBwm42018-10-011-4/+9
| | | | | There was no reason to limit this. Only some int fields had to be changed to size_t.
* demux_lavf: v4l streams are not seekablewm42018-10-011-0/+2
| | | | | | | FFmpeg is retarded enough not to give us any indication whether it is (unless we query fields not in the ABI/API). I bet FFmpeg developers love it when library users have to litter their code with duplicated information.
* ao_audiounit: rename pause function to resetJosh Lehman2018-09-301-1/+1
| | | | | AudioUnit output driver uses the pull based api so it should have a reset function instead of a pause function.
* cocoa-cb: add Apple Software Renderer supportAkemi2018-09-305-3/+42
| | | | | | by default the pixel format creation falls back to software renderer when everything fails. this is mostly needed for VMs. additionally one can directly request an sw renderer or exclude it entirely.
* cocoa-cb: move macOS option retrieval to the earliest point possibleAkemi2018-09-302-6/+6
| | | | | | | moved the retrieval of the macOS specific options from the backend initialisation to the initialisation of the CocoaCB class, the earliest point possible. this way macOS specific options can be used for the opengl context creation for example.
* add swift as main dependency so all dependencies can be disabled easilyAkemi2018-09-302-2/+9
|
* build: check for Swift version and disable dependencies if neededAkemi2018-09-303-4/+11
|
* Improve readme aesthetics.Aman2018-09-301-7/+5
| | | | | This fixes the line under the header, creates a title header, and slightly improves list formatting.
* drm_atomic: Allow to create atomic context w/o drmprime video planeAnton Kindestam2018-09-302-6/+11
| | | | | | | | | | | | | | | This is to improve the experience when running with default settings on a driver that doesn't have any overlay planes (or indeed only one plane), but still supports DRM atomic. Since the drmprime video plane is set to pick an overlay plane by default it would fail on these drivers due to not being able to create any atomic context. Users with such cards had to specify --drm-video-plane-id manually to some bogus value (it's not used after all). The "video" plane is only ever used by the drmprime-drm hwdec interop, which is not used at all in the typical usecase where everything is actually rendered on to the "OSD" plane using EGL, so having an atomic context without the "video" plane should be fine most of the time.
* manpage: minor fix to --drm-formatAnton Kindestam2018-09-301-1/+1
| | | | Looking at other examples, a bar should be used when listing OPT_CHOICE options.
* demux/packet: fix demux_packet_shortenTom Yan2018-09-301-2/+2
| | | | for the rawaudio demuxer to do the expected gapless playback
* travis: enable CI for release branchesJan Ekström2018-09-291-0/+1
|
* vo_gpu: fix vec3 packing in UBOs/push_constantsNiklas Haas2018-09-291-11/+13
| | | | | | | | | | | For vec3, the alignment and size differ. The current code will pack a struct like { vec3; float; vec2 } into 8 machine words, whereas the spec would only use 6. This actually fixes a real bug: The only place in the code I could find where it was conceivably possible that a vec3 is followed by a float was when using --gpu-dumb-mode in combination with --gamma-factor, and only when --gpu-api=vulkan. So it's no surprised nobody ran into it yet.
* vo_gpu: use explicit offsets for push constantsNiklas Haas2018-09-291-2/+1
| | | | | | | | | These used to be unsupported long ago, but it seems glslang added support in the meantime. (I don't know which version, but I'm guessing it was long enough ago that we don't have to add a feature check) Should hopefully help make push constant layouts more robust against possible bugs either in our code or in the driver.
* ao_alsa: log the ALSA state if we get a non-XRUN errorJan Ekström2018-09-291-2/+4
| | | | | The ALSA state generally can tell us more information in case we get an unexpected error.
* ao_alsa: handle XRUNs separately from other errorsJan Ekström2018-09-291-2/+7
| | | | | | | | | According to ALSA doxy, EPIPE is a synonym to SND_PCM_STATE_XRUN, and that is a state that we should attempt to automatically recover from. In case recovery fails, log an error and return zero. A warning message will still be output for each XRUN since those are not something we should generally be receiving.
* ao_alsa: early exit get_space if paused or ALSA is not readyJan Ekström2018-09-291-0/+5
| | | | | | | | | | | This has been way too long coming, and for me to notice that a whole lot of ao_alsa functions do an early return if the AO is paused. For the STATE_SETUP case, I had this reproduced once, and never since. Still, seems like we can start calling this function before the ALSA device has been fully initialized so we might as well early exit in that case.
* man/options: emphasize ytdl_hook's script optionsRicardo Constantino2018-09-261-6/+5
|
* vo_gpu: adjust PRNG variant used by GL shaderssfan52018-09-261-1/+5
| | | | | | | | | | | Certain low-end Mali GPUs have a rather low precision and overflow during the PRNG calculations, thereby breaking e.g. deband-grain. Modify the permute() to avoid this, this does not impact the quality of PRNG output (noticeably). This problem was observed on: GL_VENDOR='ARM', GL_RENDERER='Mali-T720' GL_VERSION='OpenGL ES 3.1 v1.r15p0-00rel0.bdd9e62cdc8c88e0610a16b5901161e9'
* ytdl_hook: fix audio not being picked up for some sitesRicardo Constantino2018-09-261-2/+2
|
* ao_jack: only auto-connect to audio portsNiklas Haas2018-09-261-1/+2
| | | | | This prevents ao_jack from auto-connecting to MIDI ports (or other, hypothetical future port types).
* encode: fix expected streams when using --lavfi-complexTSaaristo2018-09-261-8/+8
| | | | | | | | | mpctx->current_track[0][STREAM_VIDEO] (and STREAM_AUDIO) are empty when using --lavfi-complex. Moving the muxer stream hinting after audio/video chain initialization and checking if the chains exist fixes encoding with --lavfi-complex. Previously, the output audio/video streams did not get prepared and the encode would fail due to unexpected stream addition.
* ci: explicitly call waf with python3Martin Herkt2018-09-112-4/+4
| | | | | | Python 2 may not be present in the CI images in the future, but waf’s shebang line still uses its executable name. Explicitly call the right major version of the interpreter.
* mp_image: strip all HDR peak information from SDR clipsNiklas Haas2018-09-051-0/+6
| | | | | | | By overriding it with 1.0 (aka SDR). This prevents blowing up on mistagged clips. Fixes #6111
* vo_gpu: switch to optimization level performanceNiklas Haas2018-09-011-1/+1
| | | | | | Upstream has this now. Didn't really make any different for me (except making the polar compute shader 2%-3% faster), but maybe it does for somebody else.
* ao_pulse: fix tlength calculationTom Yan2018-09-013-17/+3
| | | | also remove the now unused non-sensical af_fmt_seconds_to_bytes.
* Revert "ao_openal: enable building on OSX"Michael Hoang2018-08-263-27/+2
| | | | | | This reverts commit af6126adbe61fb2b6cc780025246d33df93072e6. Apple's OpenAL support is ridiculously out of date, revert back to just using OpenAL Soft on macOS (fixes #4645).
* vo_gpu: avoid overwriting compute shader block sizesNiklas Haas2018-08-261-4/+10
| | | | | | | | | | When using multiple compute shaders as part of the same pass, there can be a conflict in the block sizes. In the problematic case, the HDR detection shader can collide with the polar sampling shader. In this case, the solution is clear - the passes that can handle any size should "give in" and not overwrite the block sizes. Fixes #6083.
* af_rubberband: reset delay to 0 on resetHector Martin2018-08-251-0/+2
| | | | This fixes A-V drift on seeking
* osdep: make use of HAVE_ANDROIDTom Yan2018-08-203-4/+8
|
* wscript: split egl-android from androidTom Yan2018-08-204-9/+11
|
* manpage: fix reference to --tone-mapping by old option nameAnton Kindestam2018-08-181-1/+1
|
* ytdl_hook: always load ytdl:// links with ytdl_hook firstRicardo Constantino2018-08-171-7/+23
| | | | Suggested in IRC by sfan5.
* ao_opensles: set numBuffers to 8Tom Yan2018-08-131-1/+1
| | | | | | | | | | | | | | Apparently some Android builds/forks require this for Bluetooth audio to work as they unexpectedly accept fast flag for it. Shouldn't cause any side-effect (e.g. buffer requirement increased when on wired audio). It's a hardcoded default in the upstream AAudio implementation anyway. Ref.: https://android.googlesource.com/platform/frameworks/av/+/android-8.0.0_r1/media/libaaudio/src/legacy/AudioStreamTrack.cpp#109 https://android.googlesource.com/platform/frameworks/wilhelm/+/android-8.0.0_r1/src/android/AudioPlayer_to_android.cpp#1680 https://android.googlesource.com/platform/frameworks/av/+/android-8.0.0_r1/media/libaudioclient/AudioTrack.cpp#488
* demux_edl: add title option to override title of chapterssfan52018-08-132-1/+22
|
* player: expose hearing/visual impaired flags on audio tracksAman Gupta2018-08-135-0/+12
| | | | Signed-off-by: Aman Gupta <aman@tmm1.net>
* build: add --no-download option to bootstrap.pyPhilip Sequeira2018-08-131-0/+4
| | | | | | | With this option, the script will check that the expected waf version is present, but will simply fail if it's not, rather than trying to download it. This allows a package build script to avoid compile-time network access but still ensure it's using the right waf version.
* osx: Fix initialization and access of service menuMichael Hoang2018-08-111-2/+2
| | | | | Replace dot syntax with accessor syntax so that clang no longer errors out due to not finding the property servicesMenu on NSApp.
* cocoa-cb: fix crash on macOS 10.10Akemi2018-08-111-1/+3
| | | | | | the colorspace of the layer is only available on 10.11 and upwards. Fixes #6041
* cocoa-cb: fix crash when no screen is availableAkemi2018-08-111-1/+1
| | | | | | | | instead of force unwrapping and chaining the optional vars in our containsMouseLocation function, safely unwrap and guard the resulting var. Fixes #6062
* audio/format: decouple af_fmt_is_planar from af_fmt_to_planarTom Yan2018-08-111-16/+15
| | | | | so that af_fmt_to_planar (and hence af_fmt_from_planar) can just return the input when it is not an interleaved (planar) format.
* manpage: Correct show-text duration default valuejaseg2018-08-051-1/+1
| | | duration is parsed as an integer, and the default value is used if ```-1``` is passed. Passing ```-``` as described here causes a parameter value error.
* manpage: fix --vf exclamation mark descriptionpavelxdd2018-08-051-1/+1
| | | | | An exclamation mark disables the filter by default instead of enabling it.
* ao_opensles: update interface-changesTom Yan2018-08-051-0/+9
|
* ao_opensles: rework the heuristic of buffer/enqueue size settingTom Yan2018-08-051-18/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ao->device_buffer will only affect the enqueue size if the latter is not specified. In other word, its intended purpose will solely be setting/guarding the soft buffer size. This guarantees that the soft buffer size will be consistent no matter a specific enqueue size is set or not. (In the past it would drop to the default of the generic audio-buffer option.) opensles-frames-per-buffer has been renamed to opensles-frames-per -enqueue, as it was never purposed to set the soft buffer size. It will only make sure the size is never smaller than itself, just as before. opensles-buffer-size-in-ms is introduced to allow easy tuning of the relative (i.e. in time) soft buffer size (and enqueue size, unless the aforementioned option is set). As "device buffer" never really made sense in this AO, this option OVERRIDES audio-buffer whenever its value (including the default) is larger than 0. Setting opensl-buffer-size-in-ms to 1 allows you to equate the soft buffer size to the absolute enqueue size set with opensl-frames-per -enqueue conveniently (unless it is less than 1ms