diff options
author | Max Kellermann <max@musicpd.org> | 2017-01-15 01:21:14 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2017-01-15 01:21:14 +0100 |
commit | 193dd71600e7392f3b4a5347fa7e4b053332eb45 (patch) | |
tree | a923c90e286a110caae8d0216b5c8f2b30541f54 | |
parent | 6c293a3d7f4ce3a06fbd881349d69d2e9a69284f (diff) |
output/Thread: remember the original filter audio format in local variable
-rw-r--r-- | src/output/OutputThread.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/output/OutputThread.cxx b/src/output/OutputThread.cxx index 9120f9f7c..67d321c55 100644 --- a/src/output/OutputThread.cxx +++ b/src/output/OutputThread.cxx @@ -111,8 +111,7 @@ AudioOutput::Open() f = source.Open(request.audio_format, *request.pipe, prepared_replay_gain_filter, prepared_other_replay_gain_filter, - prepared_filter) - .WithMask(config_audio_format); + prepared_filter); if (mixer != nullptr && mixer->IsPlugin(software_mixer_plugin)) software_mixer_set_filter(*mixer, volume_filter.Get()); @@ -121,14 +120,16 @@ AudioOutput::Open() name, plugin.name)); } - if (open && f != filter_audio_format) { + const auto cf = f.WithMask(config_audio_format); + + if (open && cf != filter_audio_format) { /* if the filter's output format changes, the output must be reopened as well */ CloseOutput(true); open = false; } - filter_audio_format = f; + filter_audio_format = cf; if (!open) { try { |