commit:     9ad7a8e919e2a4f8f1fb3e8f1ad4477489f8ed25
Author:     Kostadin Shishmanov <kostadinshishmanov <AT> protonmail <DOT> com>
AuthorDate: Wed Feb  5 23:20:45 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Feb 26 18:56:13 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9ad7a8e9

net-misc/minidlna: add patch to fix build with ffmpeg 7

With ffmpeg 7, the channels field that was previously deprecated with
ffmpeg 6 has been removed entirely, which breaks the build for this
package. The patch switches to the correct way of doing it now,
which is ch_layout.nb_channels.

Doesn't break building with ffmpeg 6.

Closes: https://bugs.gentoo.org/938728
Signed-off-by: Kostadin Shishmanov <kostadinshishmanov <AT> protonmail.com>
Closes: https://github.com/gentoo/gentoo/pull/40459
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../minidlna/files/minidlna-1.3.3-ffmpeg7.patch     | 21 +++++++++++++++++++++
 net-misc/minidlna/minidlna-1.3.3.ebuild             |  3 ++-
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/net-misc/minidlna/files/minidlna-1.3.3-ffmpeg7.patch 
b/net-misc/minidlna/files/minidlna-1.3.3-ffmpeg7.patch
new file mode 100644
index 000000000000..f0d9ae3daf5a
--- /dev/null
+++ b/net-misc/minidlna/files/minidlna-1.3.3-ffmpeg7.patch
@@ -0,0 +1,21 @@
+https://bugs.gentoo.org/938728
+https://sourceforge.net/p/minidlna/discussion/879956/thread/81e45c3d64
+
+With ffmpeg 7, the channels field that was previously deprecated with
+ffmpeg 6 has been removed entirely, which breaks the build for this
+package. This patch switches to the correct way of doing it now,
+which is ch_layout.nb_channels.
+
+diff --git a/libav.h b/libav.h
+index b69752c..aed9d18 100644
+--- a/libav.h
++++ b/libav.h
+@@ -174,7 +174,7 @@ 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
+-#define lav_channels(s) s->codecpar->channels
++#define lav_channels(s) s->codecpar->ch_layout.nb_channels
+ #define lav_width(s) s->codecpar->width
+ #define lav_height(s) s->codecpar->height
+ #define lav_profile(s) s->codecpar->profile

diff --git a/net-misc/minidlna/minidlna-1.3.3.ebuild 
b/net-misc/minidlna/minidlna-1.3.3.ebuild
index e56727ba5429..2f3e5511e18c 100644
--- a/net-misc/minidlna/minidlna-1.3.3.ebuild
+++ b/net-misc/minidlna/minidlna-1.3.3.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -42,6 +42,7 @@ CONFIG_CHECK="~INOTIFY_USER"
 
 PATCHES=(
        "${WORKDIR}"/minidlna-gentoo-artwork.patch
+       "${FILESDIR}"/minidlna-1.3.3-ffmpeg7.patch
 )
 
 src_prepare() {

Reply via email to