commit 3117bdf8104f305e229f38018cf4fc84e73ea676
Author: Mamoru TASAKA <mtasaka(a)fedoraproject.org>
Date: Tue Nov 12 16:45:41 2024 +0900
Patch for ffmpeg7, basically from debian with a bit modified
moc-svn3005-ffmpeg7.patch | 46 ++++++++++++++++++++++++++++++++++++++++++++++
moc.spec | 9 ++++++++-
2 files changed, 54 insertions(+), 1 deletion(-)
---
diff --git a/moc-svn3005-ffmpeg7.patch b/moc-svn3005-ffmpeg7.patch
new file mode 100644
index 0000000..6fcb8ef
--- /dev/null
+++ b/moc-svn3005-ffmpeg7.patch
@@ -0,0 +1,46 @@
+diff -urp '--exclude=*~' trunk.orig/decoder_plugins/ffmpeg/ffmpeg.c
trunk/decoder_plugins/ffmpeg/ffmpeg.c
+--- trunk.orig/decoder_plugins/ffmpeg/ffmpeg.c 2024-11-10 21:41:24.186804394 +0900
++++ trunk/decoder_plugins/ffmpeg/ffmpeg.c 2024-11-11 17:14:28.373300243 +0900
+@@ -564,10 +564,10 @@ static bool is_seek_broken (struct ffmpe
+ /* Downmix multi-channel audios to stereo. */
+ static void set_downmixing (struct ffmpeg_data *data)
+ {
+- if (av_get_channel_layout_nb_channels (data->enc->channel_layout) <= 2)
++ if (data->enc->ch_layout.nb_channels <= 2)
+ return;
+
+- data->enc->request_channel_layout = AV_CH_LAYOUT_STEREO;
++ av_channel_layout_copy(&data->enc->ch_layout,
&(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO);
+ }
+
+ static int ffmpeg_io_read_cb (void *s, uint8_t *buf, int count)
+@@ -1134,16 +1134,16 @@ static int decode_packet (struct ffmpeg_
+ is_planar = av_sample_fmt_is_planar (data->enc->sample_fmt);
+ packed = (char *)frame->extended_data[0];
+ packed_size = frame->nb_samples * data->sample_width
+- * data->enc->channels;
++ * data->enc->ch_layout.nb_channels;
+
+- if (is_planar && data->enc->channels > 1) {
++ if (is_planar && data->enc->ch_layout.nb_channels > 1) {
+ int sample, ch;
+
+ packed = xmalloc (packed_size);
+
+ for (sample = 0; sample < frame->nb_samples; sample += 1) {
+- for (ch = 0; ch < data->enc->channels; ch += 1)
+- memcpy (packed + (sample * data->enc->channels + ch)
++ for (ch = 0; ch < data->enc->ch_layout.nb_channels; ch += 1)
++ memcpy (packed + (sample * data->enc->ch_layout.nb_channels + ch)
+ * data->sample_width,
+ (char *)frame->extended_data[ch] + sample * data->sample_width,
+ data->sample_width);
+@@ -1241,7 +1241,7 @@ static int ffmpeg_decode (void *prv_data
+ return 0;
+
+ /* FFmpeg claims to always return native endian. */
+- sound_params->channels = data->enc->channels;
++ sound_params->channels = data->enc->ch_layout.nb_channels;
+ sound_params->rate = data->enc->sample_rate;
+ sound_params->fmt = data->fmt | SFMT_NE;
+
diff --git a/moc.spec b/moc.spec
index f552980..e794be8 100644
--- a/moc.spec
+++ b/moc.spec
@@ -21,7 +21,7 @@
Name: moc
Summary: Music on Console - Console audio player for Linux/UNIX
Version: 2.6
-Release: 0.52.svn%{checkout}%{?dist}
+Release: 0.53.svn%{checkout}%{?dist}
License: GPLv3+
URL:
http://moc.daper.net
@@ -38,6 +38,9 @@ Patch1: %{name}-change_private_libdir.patch
# Initial fix for FFMpeg-5
Patch2: %{name}-bugfix-ffmpeg5.patch
Patch3: ffmpeg6.patch
+#
https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1991260...
+# slightly modified
+Patch4: %{name}-svn3005-ffmpeg7.patch
BuildRequires: pkgconfig(ncurses)
BuildRequires: pkgconfig(alsa)
@@ -88,6 +91,7 @@ files in this directory beginning from the chosen file.
%if %{without oldffmpeg}
%patch -P2 -p1
%patch -P3 -p1
+%patch -P4 -p1
%endif
%build
@@ -140,6 +144,9 @@ patchelf --set-rpath %{_libdir}/mocp/decoder_plugins
%{buildroot}%{_bindir}/*
%{_libdir}/mocp/decoder_plugins/*.so
%changelog
+* Tue Nov 12 2024 Mamoru TASAKA <mtasaka(a)fedoraproject.org> - 2.6-0.53.svn3005
+- Patch for ffmpeg7, basically from debian with a bit modified
+
* Wed Nov 06 2024 Sérgio Basto <sergio(a)serjux.com> - 2.6-0.52.svn3005
- Rebuild for ffmpeg-7