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

This commit is contained in:
Max Kellermann 2021-12-01 17:58:48 +01:00
parent cb5c6259fd
commit 1c69913eca

View File

@ -78,7 +78,9 @@ FlacDecoder::OnVorbisComment(const FLAC__StreamMetadata_VorbisComment &vc)
if (flac_parse_replay_gain(rgi, vc))
GetClient()->SubmitReplayGain(&rgi);
GetClient()->SubmitMixRamp(flac_parse_mixramp(vc));
if (auto mix_ramp = flac_parse_mixramp(vc);
mix_ramp.IsDefined())
GetClient()->SubmitMixRamp(std::move(mix_ramp));
tag = flac_vorbis_comments_to_tag(&vc);
}