diff options
author | wm4 <wm4@nowhere> | 2015-04-07 13:38:03 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-04-07 13:48:19 +0200 |
commit | d857b5f5ab24bd9261148d6c00a4add3d0970063 (patch) | |
tree | d369313c1f169ee5f1430c7740f28a03d84a6dbe /player | |
parent | 5574820f13e6402b2377281886b23800c7eb9655 (diff) |
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).
Diffstat (limited to 'player')
-rw-r--r-- | player/audio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/player/audio.c b/player/audio.c index ba692e3955..f4c69803a4 100644 --- a/player/audio.c +++ b/player/audio.c @@ -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; |