From 193dd71600e7392f3b4a5347fa7e4b053332eb45 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 15 Jan 2017 01:21:14 +0100 Subject: [PATCH] output/Thread: remember the original filter audio format in local variable --- src/output/OutputThread.cxx | 9 +++++---- 1 file 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 {