mirror of
https://github.com/mpv-player/mpv.git
synced 2026-05-07 20:02:49 +00:00
player/audio: fix incorrect check on adding delay
dac977193c 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.
This commit is contained in:
+1
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user