Browse Source

package/minidlna: Fix build with ffmpeg-7.0

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
Signed-off-by: Julien Olivain <ju.o@free.fr>
Bernd Kuhls 1 tháng trước cách đây
mục cha
commit
aa187f62d6

+ 48 - 0
package/minidlna/0001-libav.h-fix-build-with-ffmpeg-7.0.patch

@@ -0,0 +1,48 @@
+From 5f698d645d71782c78e6495efd3b5e982f7db8c4 Mon Sep 17 00:00:00 2001
+From: Bernd Kuhls <bernd@kuhls.net>
+Date: Sat, 13 Apr 2024 15:03:34 +0200
+Subject: [PATCH] libav.h: fix build with ffmpeg 7.0
+
+The old bitmask-based channel layout API was removed:
+https://git.videolan.org/?p=ffmpeg.git;a=blob_plain;f=doc/APIchanges;hb=n7.0
+
+Upstream: https://sourceforge.net/p/minidlna/patches/204/
+
+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+---
+ libav.h | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/libav.h b/libav.h
+index b69752c..d5a3358 100644
+--- a/libav.h
++++ b/libav.h
+@@ -174,7 +174,12 @@ lav_get_interlaced(AVStream *s)
+ #define lav_codec_tag(s) s->codecpar->codec_tag
+ #define lav_sample_rate(s) s->codecpar->sample_rate
+ #define lav_bit_rate(s) s->codecpar->bit_rate
++#if LIBAVCODEC_VERSION_MAJOR > 52 || \
++    (LIBAVCODEC_VERSION_MAJOR >= 52 && LIBAVCODEC_VERSION_MINOR >= 113)
++#define lav_channels(s) s->codecpar->ch_layout.nb_channels
++#else
+ #define lav_channels(s) s->codecpar->channels
++#endif
+ #define lav_width(s) s->codecpar->width
+ #define lav_height(s) s->codecpar->height
+ #define lav_profile(s) s->codecpar->profile
+@@ -186,7 +191,12 @@ lav_get_interlaced(AVStream *s)
+ #define lav_codec_tag(s) s->codec->codec_tag
+ #define lav_sample_rate(s) s->codec->sample_rate
+ #define lav_bit_rate(s) s->codec->bit_rate
++#if LIBAVCODEC_VERSION_MAJOR > 52 || \
++    (LIBAVCODEC_VERSION_MAJOR >= 52 && LIBAVCODEC_VERSION_MINOR >= 113)
++#define lav_channels(s) s->codec->ch_layout.nb_channels
++#else
+ #define lav_channels(s) s->codec->channels
++#endif
+ #define lav_width(s) s->codec->width
+ #define lav_height(s) s->codec->height
+ #define lav_profile(s) s->codec->profile
+-- 
+2.39.2
+