audio: avoid one more redundant audio filter reinit

Only reinit filters if it's actually needed. This is also slightly
easier to understand: if you look at the code, it should now be more
obvious why a reinit is needed (hopefully).
This commit is contained in:
wm4 2015-04-07 13:38:03 +02:00
parent 5574820f13
commit d857b5f5ab
1 changed files with 2 additions and 2 deletions

View File

@ -260,8 +260,6 @@ void reinit_audio_chain(struct MPContext *mpctx)
}
if (!mpctx->ao) {
afs->initialized = 0; // do it again
mp_chmap_remove_useless_channels(&afs->output.channels,
&opts->audio_output_channels);
mp_audio_set_channels(&afs->output, &afs->output.channels);
@ -281,6 +279,8 @@ void reinit_audio_chain(struct MPContext *mpctx)
mp_audio_buffer_reinit(mpctx->ao_buffer, &fmt);
afs->output = fmt;
if (!mp_audio_config_equals(&afs->output, &afs->filter_output))
afs->initialized = 0;
mpctx->ao_decoder_fmt = talloc(NULL, struct mp_audio);
*mpctx->ao_decoder_fmt = in_format;