From 6b23d6fcef9f480ebbcada1ffa98d16125a570ba Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 17 May 2023 17:56:57 -0700 Subject: [PATCH] mpd: Fix build with clang-16 Signed-off-by: Khem Raj --- ...lugin-Fix-type-mismatch-for-std-span.patch | 28 +++++++++++++++++++ .../recipes-multimedia/musicpd/mpd_0.23.12.bb | 1 + 2 files changed, 29 insertions(+) create mode 100644 meta-multimedia/recipes-multimedia/musicpd/mpd/0001-SndfileDecoderPlugin-Fix-type-mismatch-for-std-span.patch diff --git a/meta-multimedia/recipes-multimedia/musicpd/mpd/0001-SndfileDecoderPlugin-Fix-type-mismatch-for-std-span.patch b/meta-multimedia/recipes-multimedia/musicpd/mpd/0001-SndfileDecoderPlugin-Fix-type-mismatch-for-std-span.patch new file mode 100644 index 0000000000..37aa448e95 --- /dev/null +++ b/meta-multimedia/recipes-multimedia/musicpd/mpd/0001-SndfileDecoderPlugin-Fix-type-mismatch-for-std-span.patch @@ -0,0 +1,28 @@ +From f2fbfeeb9c4ff7aa9ba4b95604ee0fb14ecec763 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 17 May 2023 17:54:09 -0700 +Subject: [PATCH] SndfileDecoderPlugin: Fix type mismatch for std::span + +Fixes +../git/src/decoder/plugins/SndfileDecoderPlugin.cxx:231:25: error: non-constant-expression cannot be narrowed from type 'sf_count_t' (aka 'long long') to 'size_type' (aka 'unsigned int') in initializer list [-Wc++11-narrowing] + std::span{buffer, num_frames * frame_size}, + ^~~~~~~~~~~~~~~~~~~~~~~ +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + src/decoder/plugins/SndfileDecoderPlugin.cxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/decoder/plugins/SndfileDecoderPlugin.cxx b/src/decoder/plugins/SndfileDecoderPlugin.cxx +index ad3908847..a3cb87ca9 100644 +--- a/src/decoder/plugins/SndfileDecoderPlugin.cxx ++++ b/src/decoder/plugins/SndfileDecoderPlugin.cxx +@@ -228,7 +228,7 @@ sndfile_stream_decode(DecoderClient &client, InputStream &is) + break; + + cmd = client.SubmitAudio(is, +- std::span{buffer, num_frames * frame_size}, ++ std::span{buffer, static_cast(num_frames * frame_size)}, + 0); + if (cmd == DecoderCommand::SEEK) { + sf_count_t c = client.GetSeekFrame(); diff --git a/meta-multimedia/recipes-multimedia/musicpd/mpd_0.23.12.bb b/meta-multimedia/recipes-multimedia/musicpd/mpd_0.23.12.bb index c6672ca46b..0c309ded00 100644 --- a/meta-multimedia/recipes-multimedia/musicpd/mpd_0.23.12.bb +++ b/meta-multimedia/recipes-multimedia/musicpd/mpd_0.23.12.bb @@ -22,6 +22,7 @@ SRC_URI = "git://github.com/MusicPlayerDaemon/MPD;branch=master;protocol=https \ file://mpd.conf.in \ file://minor-fixup-for-libfmt10.patch \ file://fix-build-error-when-fmt-updated.patch \ + file://0001-SndfileDecoderPlugin-Fix-type-mismatch-for-std-span.patch \ " SRCREV = "b1422fbda40a1831d397fb161e7a555443c2a072" S = "${WORKDIR}/git"