0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00
mpv/player
Dudemanguy dac977193c player: don't calculate av delay if there's no audio or video
The point of the mpctx->delay field is for calculating a/v sync and
adjusting the frame timings appropriately. However, the frame_time was
always subtracted from mpctx->delay regardless of the audio status. This
meant that for a video with no audio, every single frame had a
subtraction with nothing ever added to it meaning that you get massive
negative delay times. For weird videos where the audio starts way later,
the massive delay leads to the VO sleeping for basically about as long
as the video was previously playing without audio. This results in
nothing being rendered during that brief period of time and just overall
badness. When using display-sync, it happens to work since the video
doesn't adjust itself based on audio and it renders anyway.

The fix is to simply not touch mpctx->delay in player/video.c unless
there's actually audio playing. This is what the rest of the code
already does aside from setting it to 0 on resets or EOFs. Move the
calculation into adjust_sync after the audio status check. It works
exactly the same as before except that we don't constantly subtract
bogus values when there's no audio playing. The reverse situation in
player/audio.c also has the same issue. For something that is only
audio, mpctx->delay is always added to but nothing will ever subtract
from it. It's not really clear if this particular version could ever
cause a real bug, but logically it needs to be guarded in the same way.
The field here should only be updated if the video is actually playing.

Fixes #12025.
2023-10-25 15:43:07 +00:00
..
javascript build: remove outdated generated directory 2023-07-31 19:00:06 +00:00
lua console.lua: complete choice and flag options 2023-10-25 15:42:33 +00:00
audio.c player: don't calculate av delay if there's no audio or video 2023-10-25 15:43:07 +00:00
client.c m_option: initialize m_option_value union properly 2023-10-23 20:33:51 +02:00
client.h scripting: remove race condition when toggling internal scripts 2020-03-26 23:59:44 +01:00
command.c m_option: initialize m_option_value union properly 2023-10-23 20:33:51 +02:00
command.h various: add missing include in header flles 2023-09-21 14:40:11 +00:00
configfiles.c player: always write redirect entries for resuming playback 2023-08-28 18:31:17 +00:00
core.h various: sort some standard headers 2023-10-20 21:31:09 +02:00
external_files.c external_files: remove duplicate from cover art whitelist 2023-10-04 15:31:38 +00:00
external_files.h player: make all autoload extensions configurable 2023-08-26 00:33:00 +00:00
javascript.c build: remove outdated generated directory 2023-07-31 19:00:06 +00:00
loadfile.c player: remove unused mutate argument in mp_next_file 2023-10-05 17:09:43 +02:00
lua.c build: remove outdated generated directory 2023-07-31 19:00:06 +00:00
main.c meson: make libplacebo a required dependency 2023-10-23 13:03:29 +02:00
meson.build build: remove outdated generated directory 2023-07-31 19:00:06 +00:00
misc.c vo_wayland: fix warning -Wvoid-pointer-to-enum-cast 2023-02-26 16:45:07 +01:00
osd.c player: add --term-remaining-playtime option 2023-08-13 19:58:20 +00:00
playloop.c dispatch: change mp_dispatch_queue_process timer to nanoseconds 2023-10-16 15:38:59 +00:00
screenshot.c win32/pthread: define _POSIX_TIMERS to notify they are not supported 2023-09-29 20:48:58 +00:00
screenshot.h player: make screenshot each-frame mode more accurate 2020-02-07 13:32:21 +01:00
scripting.c cplugin: allow loading mpv_* symbols dynamically 2023-09-20 02:16:45 +00:00
sub.c sub: update subtitles if current track is an image 2023-10-23 19:32:53 +00:00
video.c player: don't calculate av delay if there's no audio or video 2023-10-25 15:43:07 +00:00