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 #10018
Fixes #9835
Fixes #8904
This commit is contained in:
Thomas Weißschuh
2022-08-04 08:14:56 +02:00
committed by Philip Langdale
parent 25fa1b0b45
commit 52aed495cb
+1
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);
} }