summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-11-12 14:15:49 +0100
committerwm4 <wm4@nowhere>2014-11-12 14:19:16 +0100
commitf0efd0b1006c3d337d619747374408bf4b896392 (patch)
tree1a9dba54f860bf65a459484628203c92173ce2a5
parent4f63a812de6ed8a76dde2a3739513933748ac2af (diff)
downloadmpv-f0efd0b1006c3d337d619747374408bf4b896392.tar.bz2
mpv-f0efd0b1006c3d337d619747374408bf4b896392.tar.xz
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.)
-rw-r--r--player/audio.c3
1 files changed, 3 insertions, 0 deletions
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)