decoder/mad: submit MixRamp only if there is actual data

Fixes MixRamp failures when a MP3 file has two ID3 tags, one of them
without MixRamp.
This commit is contained in:
Max Kellermann 2021-12-01 17:15:57 +01:00
parent bf287fefb5
commit cb5c6259fd
1 changed files with 3 additions and 1 deletions

View File

@ -310,7 +310,9 @@ MadDecoder::ParseId3(size_t tagsize, Tag *mpd_tag) noexcept
found_replay_gain = true;
}
client->SubmitMixRamp(Id3ToMixRampInfo(id3_tag.get()));
if (auto mix_ramp = Id3ToMixRampInfo(id3_tag.get());
mix_ramp.IsDefined())
client->SubmitMixRamp(std::move(mix_ramp));
}
#else /* !ENABLE_ID3TAG */