mirror of https://github.com/mpv-player/mpv
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:
parent
5574820f13
commit
d857b5f5ab
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue