minidlna: Add patch to add compatibility with ffmpeg-7.0

- From ffmpeg-7.0 the channel_layout variable has been changed to ch_layout. A minidlna
   user has submitted a patch to minidlna in May 2024 to fix this. Without this patch
   minidlna fails to build with ffmpeg-7.0 onwards.
- The patch has not yet been merged with minidlna (last commit was in May 2023) so I have
   taken the patch and applied it to the minidlna source tarball.
- Update of rootfile not required

Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Adolf Belka
2024-08-21 20:46:09 +02:00
committed by Michael Tremer
parent ba6d6014ff
commit c48dfb2d8f
2 changed files with 27 additions and 2 deletions

View File

@@ -34,7 +34,7 @@ DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
PROG = minidlna
PAK_VER = 15
PAK_VER = 16
DEPS = ffmpeg flac libexif libid3tag libogg
@@ -84,7 +84,9 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
$(UPDATE_AUTOMAKE)
cd $(DIR_APP) && ./configure --prefix=/usr
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/minidlna-1.3.3_add_compatibility_with_ffmpeg_7.0.patch
cd $(DIR_APP) && ./configure \
--prefix=/usr
cd $(DIR_APP) && make $(MAKETUNING) $(EXTRA_MAKE)
cd $(DIR_APP) && make install

View File

@@ -0,0 +1,23 @@
--- minidlna-1.3.3/libav.h.orig 2023-05-31 10:25:59.000000000 +0200
+++ minidlna-1.3.3/libav.h 2024-08-21 15:34:14.374621920 +0200
@@ -117,6 +117,8 @@
# endif
#endif
+#define HAVE_CH_LAYOUT (LIBAVUTIL_VERSION_INT >= ((57<<16)+(28<<8)+100))
+
static inline int
lav_open(AVFormatContext **ctx, const char *filename)
{
@@ -174,7 +176,11 @@
#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 HAVE_CH_LAYOUT
+#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