Skip to content

Commit

Permalink
fix(soundsourceflac): Fix -Wswitch when building with FLAC >= 1.4.0
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Holzhaus committed Sep 29, 2022
1 parent c12f6ff commit 017bdd2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/sources/soundsourceflac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 017bdd2

Please sign in to comment.