Describe the bug
Commit 2c6fa6f incorrectly changed the ReplayGain fallback behavior. See src/replaygain.c for the specific part that matters.
For example:
A track lacking album gain will have settings->albumgain = db_to_amp((float)atof (trackgain)); but it won't be used because settings->has_album_gain = 1; was never run. If the ReplayGain source mode is set to Album, then the file is treated like there is no album gain.
To Reproduce
Steps to reproduce the behavior:
- Have a file with track gain and no album gain.
- Set ReplayGain source mode to "Album".
- Play the file.
- Track will play with "Preamp without RG info" value.
Expected behavior
ReplayGain should fallback to the album/track value if the other is missing as per #1856.
Desktop:
I don't think this matters but for completeness:
- OS: Linux Mint 22.3 (Cinnamon)
- Deadbeef Version 1.10.2. Problem introduced in 1.10.1 and exists in current git master here
Code snippet of problem:
if (albumgain) {
settings->has_album_gain = 1;
}
if (trackgain) {
settings->has_track_gain = 1;
}
if (settings->processing_flags & DDB_RG_PROCESSING_GAIN) {
if (albumgain) {
settings->albumgain = db_to_amp((float)atof (albumgain));
}
else if (trackgain) {
settings->albumgain = db_to_amp((float)atof (trackgain));
}
if (trackgain) {
settings->trackgain = db_to_amp((float)atof (trackgain));
}
else if (albumgain) {
settings->trackgain = db_to_amp((float)atof (albumgain));
}
}
Code snippet of previously working code:
if (settings->processing_flags & DDB_RG_PROCESSING_GAIN) {
if (albumgain) {
settings->albumgain = db_to_amp((float)atof (albumgain));
settings->has_album_gain = 1;
}
else if (trackgain) {
settings->albumgain = db_to_amp((float)atof (trackgain));
settings->has_album_gain = 1;
}
if (trackgain) {
settings->trackgain = db_to_amp((float)atof (trackgain));
settings->has_track_gain = 1;
}
else if (albumgain) {
settings->trackgain = db_to_amp((float)atof (albumgain));
settings->has_track_gain = 1;
}
}
Describe the bug
Commit 2c6fa6f incorrectly changed the ReplayGain fallback behavior. See src/replaygain.c for the specific part that matters.
For example:
A track lacking album gain will have
settings->albumgain = db_to_amp((float)atof (trackgain));but it won't be used becausesettings->has_album_gain = 1;was never run. If the ReplayGain source mode is set to Album, then the file is treated like there is no album gain.To Reproduce
Steps to reproduce the behavior:
Expected behavior
ReplayGain should fallback to the album/track value if the other is missing as per #1856.
Desktop:
I don't think this matters but for completeness:
Code snippet of problem:
Code snippet of previously working code: