audio: block ao buffer for keep-open

This prevents the pause state from triggering before the audio output is
finished playing back audio. This is particularly helpful for gapless
audio.
This commit is contained in:
dudemanguy 2019-08-30 13:11:39 -05:00 committed by sfan5
parent 10a1b98082
commit 6e6ec33168
1 changed files with 4 additions and 1 deletions

View File

@ -846,8 +846,11 @@ static void handle_keep_open(struct MPContext *mpctx)
seek_to_last_frame(mpctx);
mpctx->playback_pts = mpctx->last_vo_pts;
}
if (opts->keep_open_pause)
if (opts->keep_open_pause) {
if (mpctx->ao)
ao_drain(mpctx->ao);
set_pause_state(mpctx, true);
}
}
}