diff -Nru chromaprint-1.5.1/debian/changelog chromaprint-1.5.1/debian/changelog --- chromaprint-1.5.1/debian/changelog 2022-01-05 17:45:01.000000000 +0000 +++ chromaprint-1.5.1/debian/changelog 2022-02-16 22:02:01.000000000 +0000 @@ -1,3 +1,13 @@ +chromaprint (1.5.1-2) unstable; urgency=medium + + [ Debian Janitor ] + * Remove constraints unnecessary since buster + + [ Sebastian Ramacher ] + * debian/patches: Apply fix for ffmpeg 5.0 (Closes: #1004785) + + -- Sebastian Ramacher Wed, 16 Feb 2022 23:02:01 +0100 + chromaprint (1.5.1-1) unstable; urgency=medium * New upstream version 1.5.1 diff -Nru chromaprint-1.5.1/debian/control chromaprint-1.5.1/debian/control --- chromaprint-1.5.1/debian/control 2022-01-05 17:44:40.000000000 +0000 +++ chromaprint-1.5.1/debian/control 2022-02-16 21:58:19.000000000 +0000 @@ -11,7 +11,7 @@ libavformat-dev, libgtest-dev , libswresample-dev, - python3-docutils (>= 0.6) + python3-docutils Standards-Version: 4.6.0 Section: libs Homepage: https://acoustid.org/chromaprint diff -Nru chromaprint-1.5.1/debian/patches/0001-Port-to-ffmpeg-5.0.patch chromaprint-1.5.1/debian/patches/0001-Port-to-ffmpeg-5.0.patch --- chromaprint-1.5.1/debian/patches/0001-Port-to-ffmpeg-5.0.patch 1970-01-01 00:00:00.000000000 +0000 +++ chromaprint-1.5.1/debian/patches/0001-Port-to-ffmpeg-5.0.patch 2022-02-16 21:58:19.000000000 +0000 @@ -0,0 +1,73 @@ +From: =?utf-8?q?Bernhard_Rosenkr=C3=A4nzer?= +Date: Mon, 17 Jan 2022 04:41:33 +0100 +Subject: Port to ffmpeg 5.0 +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 8bit + +Replace removed functionality like accessing the codec context +from an AVStream and avcodec_decode_audio4() + +Signed-off-by: Bernhard Rosenkränzer +--- + src/audio/ffmpeg_audio_reader.h | 24 ++++++++++++++++++++++-- + 1 file changed, 22 insertions(+), 2 deletions(-) + +diff --git a/src/audio/ffmpeg_audio_reader.h b/src/audio/ffmpeg_audio_reader.h +index 5550164..a3b8de7 100644 +--- a/src/audio/ffmpeg_audio_reader.h ++++ b/src/audio/ffmpeg_audio_reader.h +@@ -74,7 +74,7 @@ private: + uint8_t *m_convert_buffer[1] = { nullptr }; + int m_convert_buffer_nb_samples = 0; + +- AVInputFormat *m_input_fmt = nullptr; ++ const AVInputFormat *m_input_fmt = nullptr; + AVDictionary *m_input_opts = nullptr; + + AVFormatContext *m_format_ctx = nullptr; +@@ -153,7 +153,7 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) { + return false; + } + +- AVCodec *codec; ++ const AVCodec *codec; + ret = av_find_best_stream(m_format_ctx, AVMEDIA_TYPE_AUDIO, -1, -1, &codec, 0); + if (ret < 0) { + SetError("Could not find any audio stream in the file", ret); +@@ -161,7 +161,13 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) { + } + m_stream_index = ret; + ++#if LIBAVCODEC_VERSION_MAJOR >= 59 ++ const AVCodec *streamcodec = avcodec_find_decoder(m_format_ctx->streams[m_stream_index]->codecpar->codec_id); ++ m_codec_ctx = avcodec_alloc_context3(streamcodec); ++ avcodec_parameters_to_context(m_codec_ctx, m_format_ctx->streams[m_stream_index]->codecpar); ++#else + m_codec_ctx = m_format_ctx->streams[m_stream_index]->codec; ++#endif + m_codec_ctx->request_sample_fmt = AV_SAMPLE_FMT_S16; + + ret = avcodec_open2(m_codec_ctx, codec, nullptr); +@@ -278,7 +284,21 @@ inline bool FFmpegAudioReader::Read(const int16_t **data, size_t *size) { + } + } + ++#if LIBAVCODEC_VERSION_MAJOR < 59 + ret = avcodec_decode_audio4(m_codec_ctx, m_frame, &m_got_frame, &m_packet); ++#else ++ ret = avcodec_receive_frame(m_codec_ctx, m_frame); ++ if (ret == 0) ++ m_got_frame = true; ++ if(ret == AVERROR(EAGAIN)) ++ ret = 0; ++ if (ret == 0) ++ ret = avcodec_send_packet(m_codec_ctx, &m_packet); ++ if (ret == AVERROR(EAGAIN)) ++ ret = 0; ++ if (ret >= 0) ++ ret = m_packet.size; ++#endif + if (ret < 0) { + if (m_decode_error) { + SetError("Error decoding audio frame", m_decode_error); diff -Nru chromaprint-1.5.1/debian/patches/0002-Adopt-ffmpeg-5.0-fix-to-work-with-ffmpeg-4.4.patch chromaprint-1.5.1/debian/patches/0002-Adopt-ffmpeg-5.0-fix-to-work-with-ffmpeg-4.4.patch --- chromaprint-1.5.1/debian/patches/0002-Adopt-ffmpeg-5.0-fix-to-work-with-ffmpeg-4.4.patch 1970-01-01 00:00:00.000000000 +0000 +++ chromaprint-1.5.1/debian/patches/0002-Adopt-ffmpeg-5.0-fix-to-work-with-ffmpeg-4.4.patch 2022-02-16 21:58:19.000000000 +0000 @@ -0,0 +1,36 @@ +From: Sebastian Ramacher +Date: Wed, 16 Feb 2022 22:54:01 +0100 +Subject: Adopt ffmpeg 5.0 fix to work with ffmpeg 4.4 + +--- + src/audio/ffmpeg_audio_reader.h | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/src/audio/ffmpeg_audio_reader.h b/src/audio/ffmpeg_audio_reader.h +index a3b8de7..93cacda 100644 +--- a/src/audio/ffmpeg_audio_reader.h ++++ b/src/audio/ffmpeg_audio_reader.h +@@ -74,7 +74,10 @@ private: + uint8_t *m_convert_buffer[1] = { nullptr }; + int m_convert_buffer_nb_samples = 0; + +- const AVInputFormat *m_input_fmt = nullptr; ++#if LIBAVFORMAT_VERSION_MAJOR >= 59 ++ const ++#endif ++ AVInputFormat *m_input_fmt = nullptr; + AVDictionary *m_input_opts = nullptr; + + AVFormatContext *m_format_ctx = nullptr; +@@ -153,7 +156,10 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) { + return false; + } + +- const AVCodec *codec; ++#if LIBAVCODEC_VERSION_MAJOR >= 59 ++ const ++#endif ++ AVCodec *codec; + ret = av_find_best_stream(m_format_ctx, AVMEDIA_TYPE_AUDIO, -1, -1, &codec, 0); + if (ret < 0) { + SetError("Could not find any audio stream in the file", ret); diff -Nru chromaprint-1.5.1/debian/patches/series chromaprint-1.5.1/debian/patches/series --- chromaprint-1.5.1/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ chromaprint-1.5.1/debian/patches/series 2022-02-16 21:58:19.000000000 +0000 @@ -0,0 +1,2 @@ +0001-Port-to-ffmpeg-5.0.patch +0002-Adopt-ffmpeg-5.0-fix-to-work-with-ffmpeg-4.4.patch