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
This commit is contained in:
wm4 2014-09-05 17:48:15 +02:00 committed by Alessandro Ghedini
parent 0ba2da8a76
commit 3c7d49c38f
1 changed files with 6 additions and 0 deletions

View File

@ -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);