summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* vo_opengl: win32: try to enable DwmFlush by defaultwm42015-11-013-11/+52
| | | | | | | | | | | | | | Enable it by default, but not unconditionally. Add an "auto" mode, which disable DwmFlush if the compositor is (probably) inactive. Let's see how this goes. Since I accidentally enabled DwmFlush always by default (more or less) in a previous commit touching this code, this is probably mostly just cargo-culting, and it's uncertain whether it does anything. Note that I still got bad vsync behavior when fullscreening mpv, and making another window visible on the same screen. This happens even if forcing DWM.
* player: another fix to A/V difference calculation in display-sync modewm42015-11-011-1/+1
| | | | | | | update_av_diff() works on the timestamps, while time_left is in real time. When playing at not-1 speed, these are very different, and cause the A/V difference to jitter. Fix this by scaling the expected A/V desync to the correct range.
* vo: fix no-audio mode with interpolation enabled/display-sync disabledwm42015-11-011-1/+1
| | | | | | | Commit acd5816a broke this. It was stopping playback occasionally. Another case where the non-display-sync interpolation mode (in->vsync_timed==true) is causing a lot of subtle issues and will be removed soon.
* video: fix playback of pal8wm42015-11-011-1/+2
| | | | | | | | | | | PAL8 is the only format that is RGB, has only 1 component, is byte- aligned. It was accidentally detected by the GBRP case as planar RGB. (It would have been ok if it were gray; what ruins it is that it's actually paletted, and the color values do not correspond to colors (but palette entries). Pseudo-pal formats are ok; in fact AV_PIX_FMT_GRAY is rightfully marked as MP_IMGFLAG_YUV_P.
* video: fix another A/V difference bug in display-sync modewm42015-10-311-2/+3
| | | | | | | | | | | | | | | This didn't show up with cases where the frame pattern has a cycle of 1 or 2 like it is the case with 24-on-24 fps, or 24-on-60 fps. It did show up with 25-on-60 fps. (We don't slow down 25 fps video to 24 on default settings.) In this case, we must not add the timing error of the next frame to the A/V difference estimation of the current frame. Use the previous timing error instead. This is another bug resulting from the confusion about whether we calculate parameters for the currently playing frame, or the one we're about to queue.
* vo_direct3d: fix operationwm42015-10-313-10/+3
| | | | | | | | | Regression since commit 93db4233. I think the bit that was forgotten here was to remove the vo_w32_config() return value completely. The VO failed to init because that function always returned 0. This commit removes these bits and fixes the VO. Fixes #2434.
* SVG version of the icon (with symbolic counterpart)Evgeny Kolesnikov2015-10-303-0/+352
|
* vo_opengl: add vsync-fences optionwm42015-10-304-0/+41
| | | | | | | | | | | | | | | | | | | | | | Yet another relatively useless option that tries to make OpenGL's sync behavior somewhat sane. The results are not too encouraging. With a value of 1, vsync jitter is gone on nVidia, but there are frame drops (less than with glfinish). With 2, I get the usual vsync jitter _and_ frame drops. There's still some hope that it might prevent too deep queuing with some GPUs, I guess. The timeout for the wait call is 1 second. The value is pretty arbitrary; it should just not be too high to freeze the process (if the GPU is un-nice), and not too low to trigger the timeout in normal cases, even if the GPU load is very high. So I guess 1 second is ok as a timeout. The idea to use fences this way to control the queue depth was stolen from RetroArch: https://github.com/libretro/RetroArch/blob/df01279cf318e7ec90ace039d60515296e3de908/gfx/drivers/gl.c#L1856
* vo_opengl: cosmetics: flip the order of 2 functionswm42015-10-301-16/+16
| | | | | draw_frame() is called first, then flip_page(). Order them in the order they're called.
* vo_drm: uninstall signal handlers after quittingrr-2015-10-301-0/+2
|
* vo_drm: handle possible errors from sigactionrr-2015-10-301-6/+17
|
* vo_drm: check if signal already usedrr-2015-10-301-5/+23
|
* stream/audio: fix unchecked strdupswm42015-10-304-11/+23
| | | | | See #2435. It's literally a waste of time trying to fix minor memory leaks in this old, unused, and crappy code.
* command: add mistimed-frame-count propertywm42015-10-304-3/+26
| | | | | Does what the manpage says. This is a replacement incrementing the dropped frame counter (see previous commit).
* video: fix framedrop accounting in display-sync modewm42015-10-302-2/+1
| | | | | | | | | | | | | | Commit a1315c76 broke this slightly. Frame drops got counted multiple times, and also vo.c was actually trying to "render" the dropped frame over and over again (normally not a problem, since frames are always queued "tightly" in display-sync mode, but could have caused 100% CPU usage in some rare corner cases). Do not repeat already dropped frames, but still treat new frames with num_vsyncs==0 as dropped frames. Also, strictly count dropped frames in the VO. This means we don't count "soft" dropped frames anymore (frames that are shown, but for fewer vsyncs than intended). This will be adjusted in the next commit.
* vo_opengl: cache frames only in display-sync modewm42015-10-301-1/+3
| | | | | | | vo_frame.num_vsyncs can be != 1 in some cases in normal sync mode too. This is not a very exact fix, but in exchange it's robust. (These vo_frame flags are way too tricky in combination with redrawing and such.)
* vo_opengl: do not attempt to cache frames in FBO in dumb-modewm42015-10-301-1/+1
| | | | | | | | | | There were occasional shader compilation and rendering failures if FBOs were unavailable. This is caused by the FBO caching code getting active, even though FBOs are unavailable (i.e. dumb-mode). Boken by commit 97fc4f. Fixes #2432.
* manpage: briefly mention libmpvwm42015-10-301-0/+9
|
* vd_lavc: fix declarationswm42015-10-301-6/+6
| | | | | | | Fixes linker failure. How did this ever work? Apparently it did most of the time, but apparently we just got the first case where it didn't. Fixes #2433.
* manpage: extend profile documentationwm42015-10-291-1/+39
|
* vo: take normal drop path when dropping in display-sync modewm42015-10-291-4/+3
| | | | I hope there wasn't a deeper reason for exiting early.
* vo_drm: show osd in audio only modePaul B Mahol2015-10-291-8/+13
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* player: raise display sync desync tolerancewm42015-10-281-5/+2
| | | | | | | Bump it to 80, and 2 vsyncs. This is another measure against vsync jitter. Admittedly this is a bit simplistic (and we should probably estimate a stable estimated vsync phase instead), but for now this will do.
* player: reset AO stats on pause and other discontinuitieswm42015-10-281-1/+3
| | | | It's annoying.
* player: simplify display-adrop mode safeguardwm42015-10-281-8/+1
| | | | | | It's not needed, because the additional data is not appended, but is the total size of the audio buffer. The maximum size is the static audio drop size (or twice, if the audio is duplicated).
* player: minor refactor for A/V diff computationwm42015-10-281-19/+27
| | | | | | | | Calculate the A/V difference directly in the display sync code, instead of the awkward current way, which reuses the fields for audio sync. We still set time_frame, because it makes falling back to audio sync somewhat smoother.
* player: fix display sync A/V difference estimation on dropswm42015-10-281-0/+2
| | | | | | | When dropping or repeating frames, we essentially influence when the frame after the next frame will be shown, not the next frame. This led to dropping/repeating frames 2 times, because the A/V difference had a delay of one frame. Compensate it with the expected value.
* sub: remove use of semi-deprecated libass fieldwm42015-10-281-1/+0
| | | | | In newer libass version, this does nothing, and will be removed on the next API/ABI bump.
* Replace deprecated av_free_packet() callswm42015-10-284-9/+9
| | | | | | av_free_packet() got finally deprecated. Use av_packet_unref() instead, which has almost the same semantics, has existed for a while, and is available in all FFmpeg and Libav versions we support.
* demux_mkv: fix cluster skip with duration probingwm42015-10-271-6/+7
| | | | The start time probing essentially broke it.
* vo: kill non-working missed frame detectionwm42015-10-271-6/+0
| | | | | | | | | | | | | | | This was not very reliable. In the normal vo_opengl case, this didn't deal well enough with vsync jitter. Vsync timings can jitter quite extremely, up to a whole vsync duration, in which case the "missed" frame counter keeps growing, even though nothing is wrong. This behavior also messes up the A/V difference calculation, but as long as it's within tolerance, it won't provoke extra frame dropping/repeating. Real misses are harder to detect, and I might add such detection later. In the vo_opengl_cb case, this was additionally broken due to the asynchronity between renderer and VO threads.
* player: disable total-avsync-change update in display-sync modewm42015-10-271-0/+4
| | | | | The total-avsync-change property made no sense in display-sync mode (in addition to making not all that much sense in general).
* player: fix display-sync A/V calculation on high playback speedswm42015-10-271-0/+1
| | | | | | This is all kinds of stupid - update_avsync_after_frame() will multiply this value with the speed at a later point, and we only update this field for this function. (This should be refactored.)
* player: add audio drop/duplicate modewm42015-10-278-1/+66
| | | | Not very robust in the moment.
* player: simplify audio sync pts calculationwm42015-10-271-1/+1
| | | | | This was done for symmetry with adjust_sync(). But mpctx->delay is always 0 at this point, so prefer slightly simpler code.
* demux_mkv: fix duration probing for files with non-0 start timewm42015-10-261-1/+1
| | | | | When using --demuxer-mkv-probe-video-duration=full and the file did not start at timestamp 0, the reported duration was still wrong.
* ao_coreaudio_exclusive: check for maximum channel countwm42015-10-261-0/+6
| | | | | | Until recently, the channel layout code happened to catch this, but now an explicit check is needed. Otherwise, it'd try to pad the missing channels with NA in the channel map fallback code.
* client API: change error string if playback fails completelywm42015-10-261-1/+1
| | | | | It can print this if AO/VO initialization fails, which makes the wording a lie. Change it to something more diplomatically safe.
* ao_coreaudio_exclusive: fallback to stereo on unknown channel layoutswm42015-10-261-1/+10
| | | | | | | | | | | This is intended for the case when CoreAudio returns only unknown channel layouts, or no channel layout matches the number of channels the CoreAudio device forces. Assume that outputting stereo or mono to the first channels is safe, and that it's better than outputting nothing. It's notable that XBMC/kodi falls back to a static channel layout in this case. For some messed up reason, the layout it uses happens to match with the channel order in ALSA's/mpv's "7.1(alsa)" layout.
* ao_coreaudio_chmap: minor refactorwm42015-10-261-26/+22
| | | | | | Share some code between ca_init_chmap() and ca_get_active_chmap(), which also makes it look slightly nicer. No functional changes, other than the additional log message.
* ao_coreaudio_chmap: allow stereo as fallback; avoid mono fallbackwm42015-10-261-2/+5
| | | | | | | | | | | | | | | | If no channel layouts were determined (which can actually happen with some "strange" devices), the selection code was falling back to mono, because mono is always added as a fallback. This doesn't seem quite right. Allow a fallback to stereo too, if no channel layout could be retrieved at all. So we always assume that mono and stereo work, if no other layouts are available. (I still don't know what the CoreAudio stereo layout is supposed to do. It could be used to swap left and right channels. It could also be used to pad/move the channels, but I have never seen that. And it can be set to non-stereo channels, which breaks mpv. Whatever.)
* ao_coreaudio: fix another minor memory leakwm42015-10-261-1/+2
| | | | How stupid, even the cleanup gotos were already there.
* audio: bump maximum number of channels to 16wm42015-10-261-1/+1
| | | | | | | | | | | The main reason is that ao_coreaudio_exclusive needs this for some OSX devices. They want packed audio, and special-casing this in the coreaudio code would be too much of a pain. The maximum of channels we can support is 64 (because FFmpeg uses 64 bit masks for channel layouts), but since struct mp_audio can get pretty big (has static allocations of 2 pointers for each channel for planar mode), it's less wasteful to stay lower for now.
* audio: use AVFrames with more than 8 channels correctlywm42015-10-263-8/+15
| | | | | | | Requires messy dealing with the extended_ fields. Don't bother with af_lavfi and ao_lavc for now. There are probably no valid use-cases for these.
* af_lavrresample: make planarization pass work with >8 channelswm42015-10-261-4/+5
| | | | | | | | | | av_get_default_channel_layout() fails with channel counts larger than 8. The channel layout doesn't need to make sense, so pick an arbitrary fallback. libswresample also has options for setting the channel counts directly, but better not introduce new concepts in the code. Also, libavresample doesn't have these options.
* audio: improve mp_chmap_to_lavc_unchecked() unknown chmap behaviorwm42015-10-261-2/+10
| | | | | | | | | | | | | | | | | | | | | | | Change it so that it will always return a bitmask with the correct number of channels set if an unknown channel map is passed. This didn't work for channel counts larger than 8, as there are not any standard channel layouts defined with more than 8 channels (both in mpv and FFmpeg). Instead, it returned 0. This will help when raising the maximum allowed channel count in mpv. Some code in af_lavrresample relies on it, more or less. One change is that unknown channel maps won't result in lavc standard channel layouts anymore, just a set of random speakers. This should be fine, as the caller of mp_chmap_to_lavc_unchecked() should handle these cases. For mp_chmap_reorder_to_lavc() this is not so clear anymore, but should also be ok. For normal channel maps, simply dropping NA channels is still the correct and wanted behavior. Currently, the mpv maximum channel count is 8. This commit is preparation for raising this limit.
* audio: always log channel maps before determining final mapwm42015-10-265-17/+33
| | | | | Until now, this was done only in debug verbosity, while some AOs logged equivalent information in verbose mode. Clean this up.
* ao_coreaudio: fix potential UB in error caseswm42015-10-261-3/+2
| | | | | | | | | mNumberChannelDescriptions being 0 is pretty much an error, but if it can happen, then the code checking the chmap below will trigger UB, as chmap is not initialized at all. Also, simplify the code a little: we never change the number of channels, so this is just fine.
* ao_coreaudio_chmap: add more loggingwm42015-10-261-8/+10
|
* af: prevent endless loop when removing filters due to spdifwm42015-10-261-1/+2
| | | | | | | | | | | | | | | | | | | | | This code removes filters which can not take spdif inout. This was made so that PCM filters are transparently dropped in spdif mode. This entered an endless loop with: --af=lavcac3enc:::2 --audio-channels=5.1 The forced number of output channels is incompatible with spdif. It's trying to insert af_lavrresample as conversion filter to compensate for it. Of course this doesn't work, which triggers the PCM filter removal. Then it goes on normally - since the new state is exactly as before, it will try the same thing again, forever. Fix by reusing the retry counter, which is a very dumb but very effective measure against these cases of filter negotiation failure. We could try to be more clever (for example, if the removed filter is a conversion filter, we can be sure this won't work, and error out immediately). But better keep it simple and robust.
* ao_alsa: log format probing in verbose modewm42015-10-251-2/+1
| | | | | And also remove a redundant log message. (We can tell from the following probe or error message whether or not the format test is successful.)
* vd_lavc: make software decoding fallback an optionRodger Combs2015-10-252-1/+9
|
* options: remove --use-text-osdwm42015-10-245-17/+2
|
* ytdl: disable --all-subs if "sub-lang" is in raw-optionsRicardo Constantino2015-10-241-1/+9
| | | | | | Defaults stay the same (--all-subs is used if sub-lang wasn't used.) Don't forget to also add "write-sub=" if using sub-lang or else it won't work.
* vo_opengl: remove source shader leftoverBin Jin2015-10-242-3/+0
| | | | The source shader was removed after deband was introduced.
* sd_lavc: take care of AVPicture deprecationwm42015-10-233-3/+24
|
* vo_opengl: always cache to an FBO when not interpolatingNiklas Haas2015-10-231-4/+29
| | | | | | This speeds up redraws considerably (improving eg. <60 Hz material on a 60 Hz monitor with display-sync active, or redraws while paused), but slightly slows down the worst case (eg. video FPS = display FPS).
* vo: expose frame->num_vsyncs to the VO backendNiklas Haas2015-10-231-1/+0
| | | | | It's not clear why this was originally hidden, but the information is useful for allowing the VO backend to make decisions about caching.
* w32_common: disable IMEJames Ross-Gowan2015-10-231-9/+16
| | | | | | | | | | The IME is not useful for key-bindings. Handle the base ASCII chars instead and don't show the IME window. For the sake of libmpv users, the IME should only be disabled on mpv's GUI thread and not application- wide. No IME on the GUI thread should also mean that VK_PROCESSKEY will never have to be handled, so the logic for that can be removed as well.
* vo_opengl: wayland: use a more standard symbolwm42015-10-231-1/+2
| | | | | They're the same, but EGL_CONTEXT_MAJOR_VERSION_KHR technically is an extension, while EGL_CONTEXT_CLIENT_VERSION is the standardized alias.
* vo_opengl: vaapi: fix compilation failure on older systemswm42015-10-231-1/+2
| | | | | | | Older systems have certain EGL extension definitions missing. We redefine them to make the build system easier, and because it's trivial. But we forgot to define the EGL_LINUX_DMA_BUF_EXT identifier. (I hope it's the only missing one.)
* command: make bitrate properties work correctly for external trackswm42015-10-231-2/+7
|
* command: do not return 0 for bitrates if unknownwm42015-10-232-2/+5
| | | | | | | | This makes the bitrate properties unavailable, instead of returning 0 when: 1. No track is selected, or 2. Not enough packets have been read to have a bitrate estimate yet
* player: offset chapter display by start timewm42015-10-231-1/+2
| | | | | | Some mkv files can have this. The chapter times are still timestamps (and thus not affected by the start time), but it misplaces the OSD chapter ticks.
* vo_opengl_cb: fix passing through some video equalizer propertieswm42015-10-231-2/+7
| | | | | | | | | | | | | | | | | | | | | | The equalizer code as it exists in vo_opengl works perfectly fine. The situation in vo_opengl_cb is pretty different. The playback thread can't communicate with the renderer thread synchronously (essentially to give the API user more flexibility). So the equalizer communication has to be done in an asynchronous way too. There were two problems. First, the eq capabilities can change with the pixel format, and the renderer initializes them on config only. This means equalizers were disabled on the first config run, and options like --video-output-levels or --brightness would not work. So we just initialize the caps with a known superset. The player will not correctly indicate when setting an eq doesn't work, but we're fine with it, as it is a relatively cosmetic issue. Second, it copied back the eq settings in the "wrong" moment (what for?), which overwrote the settings in some cases. Third, the eq was not reset correctly on vo init. This is needed to make it behave the same as vo_opengl.
* client API: fix typo and wording in a commentwm42015-10-22