From 6e6ec331685c78584a818f524286670911e8b4af Mon Sep 17 00:00:00 2001 From: dudemanguy Date: Fri, 30 Aug 2019 13:11:39 -0500 Subject: 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. --- player/playloop.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'player') diff --git a/player/playloop.c b/player/playloop.c index 9fdd04e9a8..85cc9f7faf 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -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); + } } } -- cgit v1.2.3