From f0efd0b1006c3d337d619747374408bf4b896392 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 12 Nov 2014 14:15:49 +0100 Subject: [PATCH] audio: fix some issues when reloading the AO We absolutely need to clear the AO reference in the mixer. The audio_status must be changed to a state where no code assumes that the AO is available. (It's allowed to do this blindly.) --- player/audio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/player/audio.c b/player/audio.c index e3dbe6577c..e8516bca0d 100644 --- a/player/audio.c +++ b/player/audio.c @@ -154,6 +154,7 @@ void uninit_audio_out(struct MPContext *mpctx) // Note: with gapless_audio, stop_play is not correctly set if (mpctx->opts->gapless_audio || mpctx->stop_play == AT_END_OF_FILE) ao_drain(mpctx->ao); + mixer_uninit_audio(mpctx->mixer); ao_uninit(mpctx->ao); } mpctx->ao = NULL; @@ -443,6 +444,8 @@ static void do_fill_audio_out_buffers(struct MPContext *mpctx, double endpts) if (mpctx->ao && ao_query_and_reset_events(mpctx->ao, AO_EVENT_RELOAD)) { ao_reset(mpctx->ao); uninit_audio_out(mpctx); + if (d_audio) + mpctx->audio_status = STATUS_SYNCING; } if (!d_audio)