Bug#1004626: forked-daapd: FTBFS with ffmpeg 5.0
Package: forked-daapd
Version: 26.4+dfsg1-2
Followup-For: Bug #1004626
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu kinetic ubuntu-patch
Control: tags -1 patch
Please find attached a debdiff that cherry-picks the two commits from
upstream necessary for forked-daapd to build against ffmpeg 5.0.
This change has been uploaded to Ubuntu for the ffmpeg 5.0 transition.
Cheers,
--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer https://www.debian.org/
slangasek@ubuntu.com vorlon@debian.org
diff -Nru forked-daapd-26.4+dfsg1/debian/control forked-daapd-26.4+dfsg1/debian/control
--- forked-daapd-26.4+dfsg1/debian/control 2022-07-19 05:49:52.000000000 -0700
+++ forked-daapd-26.4+dfsg1/debian/control 2022-07-22 09:23:05.000000000 -0700
@@ -1,6 +1,5 @@
Source: forked-daapd
-Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
-XSBC-Original-Maintainer: Debian Multimedia Maintainers <debian-multimedia@lists.debian.org>
+Maintainer: Debian Multimedia Maintainers <debian-multimedia@lists.debian.org>
Section: sound
Priority: optional
Build-Depends: debhelper-compat (= 10),
diff -Nru forked-daapd-26.4+dfsg1/debian/patches/0001-main-Conditionally-disable-functions-deprecated-by-f.patch forked-daapd-26.4+dfsg1/debian/patches/0001-main-Conditionally-disable-functions-deprecated-by-f.patch
--- forked-daapd-26.4+dfsg1/debian/patches/0001-main-Conditionally-disable-functions-deprecated-by-f.patch 1969-12-31 16:00:00.000000000 -0800
+++ forked-daapd-26.4+dfsg1/debian/patches/0001-main-Conditionally-disable-functions-deprecated-by-f.patch 2022-07-22 09:23:05.000000000 -0700
@@ -0,0 +1,71 @@
+From 528a175d997cda5983add3b22f53d3a91b2b6453 Mon Sep 17 00:00:00 2001
+From: ejurgensen <espenjurgensen@gmail.com>
+Date: Wed, 3 Jul 2019 20:29:31 +0200
+Subject: [PATCH] [main] Conditionally disable functions deprecated by ffmpeg
+ 4.0
+
+av_register_all, av_lockmgr_register and avfilter_register_all
+---
+ src/main.c | 17 ++++++++++++++---
+ 1 file changed, 14 insertions(+), 3 deletions(-)
+
+Index: forked-daapd-26.4+dfsg1/src/main.c
+===================================================================
+--- forked-daapd-26.4+dfsg1.orig/src/main.c
++++ forked-daapd-26.4+dfsg1/src/main.c
+@@ -446,7 +446,7 @@
+ }
+ #endif
+
+-
++#if (LIBAVCODEC_VERSION_MAJOR < 58) || ((LIBAVCODEC_VERSION_MAJOR == 58) && (LIBAVCODEC_VERSION_MINOR < 18))
+ static int
+ ffmpeg_lockmgr(void **pmutex, enum AVLockOp op)
+ {
+@@ -477,6 +477,7 @@
+
+ return 1;
+ }
++#endif
+
+ int
+ main(int argc, char **argv)
+@@ -660,6 +661,8 @@
+ DPRINTF(E_INFO, L_MAIN, "Initialized with libav %s\n", av_version);
+ #endif
+
++// The following was deprecated with ffmpeg 4.0 = avcodec 58.18, avformat 58.12, avfilter 7.16
++#if (LIBAVCODEC_VERSION_MAJOR < 58) || ((LIBAVCODEC_VERSION_MAJOR == 58) && (LIBAVCODEC_VERSION_MINOR < 18))
+ ret = av_lockmgr_register(ffmpeg_lockmgr);
+ if (ret < 0)
+ {
+@@ -668,9 +671,14 @@
+ ret = EXIT_FAILURE;
+ goto ffmpeg_init_fail;
+ }
+-
++#endif
++#if (LIBAVFORMAT_VERSION_MAJOR < 58) || ((LIBAVFORMAT_VERSION_MAJOR == 58) && (LIBAVFORMAT_VERSION_MINOR < 12))
+ av_register_all();
++#endif
++#if (LIBAVFILTER_VERSION_MAJOR < 7) || ((LIBAVFILTER_VERSION_MAJOR == 7) && (LIBAVFILTER_VERSION_MINOR < 16))
+ avfilter_register_all();
++#endif
++
+ #if HAVE_DECL_AVFORMAT_NETWORK_INIT
+ avformat_network_init();
+ #endif
+@@ -985,9 +993,12 @@
+ #if HAVE_DECL_AVFORMAT_NETWORK_INIT
+ avformat_network_deinit();
+ #endif
+- av_lockmgr_register(NULL);
+
++#if (LIBAVCODEC_VERSION_MAJOR < 58) || ((LIBAVCODEC_VERSION_MAJOR == 58) && (LIBAVCODEC_VERSION_MINOR < 18))
++ av_lockmgr_register(NULL);
+ ffmpeg_init_fail:
++#endif
++
+ DPRINTF(E_LOG, L_MAIN, "Exiting.\n");
+ conffile_unload();
+ logger_deinit();
diff -Nru forked-daapd-26.4+dfsg1/debian/patches/0001-xcode-Remove-deprecated-ffmpeg-AVFormatContext-filen.patch forked-daapd-26.4+dfsg1/debian/patches/0001-xcode-Remove-deprecated-ffmpeg-AVFormatContext-filen.patch
--- forked-daapd-26.4+dfsg1/debian/patches/0001-xcode-Remove-deprecated-ffmpeg-AVFormatContext-filen.patch 1969-12-31 16:00:00.000000000 -0800
+++ forked-daapd-26.4+dfsg1/debian/patches/0001-xcode-Remove-deprecated-ffmpeg-AVFormatContext-filen.patch 2022-07-22 09:23:05.000000000 -0700
@@ -0,0 +1,26 @@
+From a321667201fa04dc1ded2121c71d0e0befbc990d Mon Sep 17 00:00:00 2001
+From: ejurgensen <espenjurgensen@gmail.com>
+Date: Tue, 2 Jul 2019 21:48:34 +0200
+Subject: [PATCH] [xcode] Remove deprecated ffmpeg AVFormatContext filename
+ field
+
+---
+ src/transcode.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/transcode.c b/src/transcode.c
+index 2ee9300d..71295efb 100644
+--- a/src/transcode.c
++++ b/src/transcode.c
+@@ -731,7 +731,7 @@ open_decoder(unsigned int *stream_index, struct decode_ctx *ctx, enum AVMediaTyp
+ if ((*stream_index < 0) || (!decoder))
+ {
+ if (!ctx->settings.silent)
+- DPRINTF(E_LOG, L_XCODE, "No stream data or decoder for '%s'\n", ctx->ifmt_ctx->filename);
++ DPRINTF(E_LOG, L_XCODE, "No stream data or decoder for stream #%d\n", *stream_index);
+ return NULL;
+ }
+
+--
+2.34.1
+
diff -Nru forked-daapd-26.4+dfsg1/debian/patches/series forked-daapd-26.4+dfsg1/debian/patches/series
--- forked-daapd-26.4+dfsg1/debian/patches/series 2020-08-07 23:56:47.000000000 -0700
+++ forked-daapd-26.4+dfsg1/debian/patches/series 2022-07-22 09:23:05.000000000 -0700
@@ -1,2 +1,4 @@
skip-building-htdocs.patch
0002-Fix-build-with-GCC-10.patch
+0001-main-Conditionally-disable-functions-deprecated-by-f.patch
+0001-xcode-Remove-deprecated-ffmpeg-AVFormatContext-filen.patch
Reply to: