Commit d14ec6ae authored by Max Kellermann's avatar Max Kellermann

output/Thread: reconfigure ConvertFilter for its new input AudioFormat

If the input AudioFormat changes but the out_audio_format doesn't change (e.g. because there is a fixed "format" setting in this "audio_output" section), the ConvertFilter needs to be reconfigured. This didn't happen, resulting in awful static noise after changing songs.
parent 917cedf8
......@@ -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
......
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment