summaryrefslogtreecommitdiff
path: root/src/output/Source.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-07-08 19:49:58 +0200
committerMax Kellermann <max@musicpd.org>2019-07-08 20:16:53 +0200
commitdb024c27d5912a89a51edaef143f6f74601ececa (patch)
tree844398ca4fef22d81c4609a8e8f6a9f8a0054fa5 /src/output/Source.cxx
parent326c6ae615fca967fdfb5655fbea5c782b138482 (diff)
output/Source: allow the ReplayGainFilter to change the AudioFormat
Just in case.
Diffstat (limited to 'src/output/Source.cxx')
-rw-r--r--src/output/Source.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/output/Source.cxx b/src/output/Source.cxx
index cdcc6f3a1..5dff228a3 100644
--- a/src/output/Source.cxx
+++ b/src/output/Source.cxx
@@ -99,16 +99,21 @@ try {
assert(audio_format.IsValid());
/* the replay_gain filter cannot fail here */
+ if (prepared_other_replay_gain_filter) {
+ other_replay_gain_serial = 0;
+ other_replay_gain_filter =
+ prepared_other_replay_gain_filter->Open(audio_format);
+ }
+
if (prepared_replay_gain_filter) {
replay_gain_serial = 0;
replay_gain_filter =
prepared_replay_gain_filter->Open(audio_format);
- }
- if (prepared_other_replay_gain_filter) {
- other_replay_gain_serial = 0;
- other_replay_gain_filter =
- prepared_other_replay_gain_filter->Open(audio_format);
+ audio_format = replay_gain_filter->GetOutAudioFormat();
+
+ assert(replay_gain_filter->GetOutAudioFormat() ==
+ other_replay_gain_filter->GetOutAudioFormat());
}
filter = prepared_filter.Open(audio_format);