From 017bdd247dc14a05904589c8b4033676897c1be6 Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Wed, 28 Sep 2022 10:29:57 +0200 Subject: [PATCH] fix(soundsourceflac): Fix `-Wswitch` when building with FLAC >= 1.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following warning: src/sources/soundsourceflac.cpp: In member function ‘void mixxx::SoundSourceFLAC::flacError(FLAC__StreamDecoderErrorStatus)’: src/sources/soundsourceflac.cpp:571:12: error: enumeration value ‘FLAC__STREAM_DECODER_ERROR_STATUS_BAD_METADATA’ not handled in switch [-Werror=switch] 571 | switch (status) { | ^ The enumeration value has been mentioned in the FLAC 1.3.4 to 1.4.0 porting guide: https://xiph.org/flac/api/group__porting__1__3__4__to__1__4__0.html --- src/sources/soundsourceflac.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sources/soundsourceflac.cpp b/src/sources/soundsourceflac.cpp index 9c4f1d0a92b..6f148243e75 100644 --- a/src/sources/soundsourceflac.cpp +++ b/src/sources/soundsourceflac.cpp @@ -581,6 +581,11 @@ void SoundSourceFLAC::flacError(FLAC__StreamDecoderErrorStatus status) { case FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM: error = "STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM"; break; +#if FLAC_API_VERSION_CURRENT >= 12 + case FLAC__STREAM_DECODER_ERROR_STATUS_BAD_METADATA: + error = "STREAM_DECODER_ERROR_STATUS_BAD_METADATA"; + break; +#endif } kLogger.warning() << "FLAC decoding error" << error