From 1c69913eca8caa9fbabc4297c572946685d0db74 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 1 Dec 2021 17:58:48 +0100 Subject: [PATCH] decoder/flac: submit MixRamp only if there is actual data --- src/decoder/plugins/FlacCommon.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/decoder/plugins/FlacCommon.cxx b/src/decoder/plugins/FlacCommon.cxx index 78acb9ef6..8e3bbce31 100644 --- a/src/decoder/plugins/FlacCommon.cxx +++ b/src/decoder/plugins/FlacCommon.cxx @@ -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); }