From 4cefb30dd9651eb18ad5d1f2cde391b9441ff291 Mon Sep 17 00:00:00 2001
From: Max Kellermann <max.kellermann@gmail.com>
Date: Fri, 28 Feb 2025 10:32:16 +0100
Subject: [PATCH] decoder/flac: ignore FLAC__STREAM_DECODER_END_OF_LINK (FLAC
 1.5)

Fixes -Wswitch compiler warning when building with FLAC 1.5.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/2219
---
 src/decoder/plugins/FlacDecoderPlugin.cxx | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/decoder/plugins/FlacDecoderPlugin.cxx b/src/decoder/plugins/FlacDecoderPlugin.cxx
index a4ba22948..dee831dc8 100644
--- a/src/decoder/plugins/FlacDecoderPlugin.cxx
+++ b/src/decoder/plugins/FlacDecoderPlugin.cxx
@@ -22,6 +22,9 @@ flacPrintErroredState(FLAC__StreamDecoderState state) noexcept
 	case FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC:
 	case FLAC__STREAM_DECODER_READ_FRAME:
 	case FLAC__STREAM_DECODER_END_OF_STREAM:
+#if FLAC_API_VERSION_CURRENT >= 14
+	case FLAC__STREAM_DECODER_END_OF_LINK:
+#endif
 		return;
 
 	case FLAC__STREAM_DECODER_OGG_ERROR:
@@ -216,6 +219,12 @@ flac_decoder_loop(FlacDecoder *data, FLAC__StreamDecoder *flac_dec)
 		case FLAC__STREAM_DECODER_UNINITIALIZED:
 			/* we shouldn't see this, ever - bail out */
 			return;
+
+#if FLAC_API_VERSION_CURRENT >= 14
+		case FLAC__STREAM_DECODER_END_OF_LINK:
+			/* TODO support FLAC 1.5 chained streams */
+			return;
+#endif
 		}
 
 		if (!FLAC__stream_decoder_process_single(flac_dec) &&