summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-09-05 17:48:15 +0200
committerAlessandro Ghedini <alessandro@ghedini.me>2014-09-05 21:16:59 +0200
commit3c7d49c38ff8eaebf90be9971b089f42253668de (patch)
treef4856091f490e00391bc261c023b7d058b38b3a9
parent0ba2da8a76850544ad3a0d23927bbee32d180dd6 (diff)
downloadmpv-3c7d49c38ff8eaebf90be9971b089f42253668de.tar.bz2
mpv-3c7d49c38ff8eaebf90be9971b089f42253668de.tar.xz
audio: correctly initialize output buffer
Just like the previous commit, this takes care of fallout from commit 7ab228, which fixed a bug, but introduced some new ones. CC: @mpv-player/stable
-rw-r--r--player/audio.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/player/audio.c b/player/audio.c
index 200d04d927..c96e44acfa 100644
--- a/player/audio.c
+++ b/player/audio.c
@@ -126,6 +126,12 @@ void reinit_audio_chain(struct MPContext *mpctx)
if (!audio_init_best_codec(mpctx->d_audio, opts->audio_decoders))
goto init_error;
reset_audio_state(mpctx);
+
+ if (mpctx->ao) {
+ struct mp_audio fmt;
+ ao_get_format(mpctx->ao, &fmt);
+ mp_audio_buffer_reinit(mpctx->ao_buffer, &fmt);
+ }
}
assert(mpctx->d_audio);