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
parent eba8eeda78
commit eaa1f16564
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);