Commit 5e93cfdd authored by Max Kellermann's avatar Max Kellermann

output/Source: reset the ReplayGain serials ion OpenFilter()

Each close/open cycle resets the Filter's state, because a new Filter instance is being created. That results in the serials (replay_gain_serial and other_replay_gain_serial) being out of sync with the internal ReplayGainFilter state. So instead of initializing those serials once, we need to initialize them each time we create new ReplayGainFilter instances, i.e. in OpenFilter(). https://bugs.musicpd.org/view.php?id=4632
parent d91d5a3a
ver 0.20.3 (not yet released) ver 0.20.3 (not yet released)
* protocol * protocol
- "playlistadd" creates new playlist if it does not exist, as documented - "playlistadd" creates new playlist if it does not exist, as documented
* replay gain: don't reset ReplayGain levels when unpausing playback
* silence surround channels when converting from stereo * silence surround channels when converting from stereo
* use shortcuts such as "dsd64" in log messages * use shortcuts such as "dsd64" in log messages
......
...@@ -95,13 +95,17 @@ try { ...@@ -95,13 +95,17 @@ try {
assert(audio_format.IsValid()); assert(audio_format.IsValid());
/* the replay_gain filter cannot fail here */ /* the replay_gain filter cannot fail here */
if (prepared_replay_gain_filter != nullptr) if (prepared_replay_gain_filter != nullptr) {
replay_gain_serial = 0;
replay_gain_filter_instance = replay_gain_filter_instance =
prepared_replay_gain_filter->Open(audio_format); prepared_replay_gain_filter->Open(audio_format);
}
if (prepared_other_replay_gain_filter != nullptr) if (prepared_other_replay_gain_filter != nullptr) {
other_replay_gain_serial = 0;
other_replay_gain_filter_instance = other_replay_gain_filter_instance =
prepared_other_replay_gain_filter->Open(audio_format); prepared_other_replay_gain_filter->Open(audio_format);
}
filter_instance = prepared_filter->Open(audio_format); filter_instance = prepared_filter->Open(audio_format);
} catch (...) { } catch (...) {
......
...@@ -64,13 +64,13 @@ class AudioOutputSource { ...@@ -64,13 +64,13 @@ class AudioOutputSource {
* The serial number of the last replay gain info. 0 means no * The serial number of the last replay gain info. 0 means no
* replay gain info was available. * replay gain info was available.
*/ */
unsigned replay_gain_serial = 0; unsigned replay_gain_serial;
/** /**
* The serial number of the last replay gain info by the * The serial number of the last replay gain info by the
* "other" chunk during cross-fading. * "other" chunk during cross-fading.
*/ */
unsigned other_replay_gain_serial = 0; unsigned other_replay_gain_serial;
/** /**
* The replay_gain_filter_plugin instance of this audio * The replay_gain_filter_plugin instance of this audio
......
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