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>
This commit is contained in:
Bernd Kuhls
2025-06-22 11:41:13 +02:00
committed by Julien Olivain
parent 9135a8a5aa
commit aa187f62d6

View File

@@ -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