summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rw-r--r--src/output/OutputThread.cxx12
2 files changed, 13 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 2f0809f91..8c7a2fc11 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ ver 0.20.2 (not yet released)
* resampler
- libsamplerate: reset state after seeking
* output
+ - fix static noise after changing to a different audio format
- alsa: fix the DSD_U32 sample rate
- alsa: fix the DSD_U32 byte order
- alsa: support DSD_U16
diff --git a/src/output/OutputThread.cxx b/src/output/OutputThread.cxx
index 809cae6cc..047dbe0c0 100644
--- a/src/output/OutputThread.cxx
+++ b/src/output/OutputThread.cxx
@@ -140,6 +140,18 @@ AudioOutput::Open()
}
open = true;
+ } else if (f != out_audio_format) {
+ /* reconfigure the final ConvertFilter for its new
+ input AudioFormat */
+
+ try {
+ convert_filter_set(convert_filter.Get(),
+ out_audio_format);
+ } catch (const std::runtime_error &e) {
+ Close(false);
+ std::throw_with_nested(FormatRuntimeError("Failed to convert for \"%s\" [%s]",
+ name, plugin.name));
+ }
}
if (f != source.GetInputAudioFormat() || f != out_audio_format) {