1
0
mirror of https://github.com/mpv-player/mpv synced 2025-04-01 00:07:33 +00:00

audio: drain ao on EOF

This gives pull-based AOs the chance to play all queued audio.
Also it will make sure that the audio has finished playing so we can
reinitialize the AO if format changes are necessary.

Fixes 
Fixes 
Fixes 
This commit is contained in:
Thomas Weißschuh 2022-08-04 08:14:56 +02:00 committed by Philip Langdale
parent 25fa1b0b45
commit 52aed495cb

View File

@ -945,6 +945,7 @@ void fill_audio_out_buffers(struct MPContext *mpctx)
(opts->gapless_audio && !ao_untimed(ao_c->ao)))) (opts->gapless_audio && !ao_untimed(ao_c->ao))))
{ {
MP_VERBOSE(mpctx, "audio EOF reached\n"); MP_VERBOSE(mpctx, "audio EOF reached\n");
ao_drain(mpctx->ao);
mpctx->audio_status = STATUS_EOF; mpctx->audio_status = STATUS_EOF;
mp_wakeup_core(mpctx); mp_wakeup_core(mpctx);
} }