mirror of
https://github.com/mpv-player/mpv
synced 2024-12-24 15:52:25 +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:
parent
729f2fed2c
commit
66fb1d1cdb
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user