summaryrefslogtreecommitdiffstats
path: root/player/audio.c
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-10-26 22:59:09 -0500
committerDudemanguy <random342@airmail.cc>2023-10-26 22:59:09 -0500
commit66fb1d1cdb7734be399981c99a0ee4e985f10f0f (patch)
treefb438a777e385c092f064f0c78d37c3bcf033254 /player/audio.c
parent729f2fed2ce1d00df7b14983bfe0c761d1dff51e (diff)
downloadmpv-66fb1d1cdb7734be399981c99a0ee4e985f10f0f.tar.bz2
mpv-66fb1d1cdb7734be399981c99a0ee4e985f10f0f.tar.xz
player/audio: fix incorrect check on adding delay
dac977193cccbf7e2e999cf0c4b0292314839c4c changed adding delay to only when the video is playing but this isn't correct. The video frames adjust themselves based on the audio, so if we still have audio processing while the video itself happens to be in some non-playing state (such as STATUS_READY), the delay still needs to be taken into account. The correct thing to check is to make sure that it is not STATUS_EOF. STATUS_EOF covers the case where we have still image, and of course no video at all is STATUS_EOF. So having a massive bogus delay value is still avoided.
Diffstat (limited to 'player/audio.c')
-rw-r--r--player/audio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/player/audio.c b/player/audio.c
index ba3cc90e7b..ca17d3325b 100644
--- a/player/audio.c
+++ b/player/audio.c
@@ -723,7 +723,7 @@ static void ao_process(struct mp_filter *f)
mpctx->shown_aframes += samples;
double real_samplerate = mp_aframe_get_rate(af) / mpctx->audio_speed;
- if (mpctx->video_status == STATUS_PLAYING)
+ if (mpctx->video_status != STATUS_EOF)
mpctx->delay += samples / real_samplerate;
ao_c->last_out_pts = mp_aframe_end_pts(af);
update_throttle(mpctx);