Merge ~liushuyu-011/ubuntu/+source/moc:ubuntu/devel into ubuntu/+source/moc:ubuntu/devel

Proposed by Zixing Liu
Status: Merged
Merged at revision: e8dab36e9fffeb883dbcf9e03ee0ffd7c21ab2e1
Proposed branch: ~liushuyu-011/ubuntu/+source/moc:ubuntu/devel
Merge into: ubuntu/+source/moc:ubuntu/devel
Diff against target: 76 lines (+54/-0)
3 files modified
debian/changelog (+6/-0)
debian/patches/1000-ffmpeg-7.0.patch (+47/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Graham Inggs (community) Approve
Review via email: mp+473387@code.launchpad.net

Description of the change

This merge proposal fixes FTBFS for moc with FFmpeg 7.

To post a comment you must log in.
Revision history for this message
Graham Inggs (ginggs) wrote :

Looks good to me, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index f664cf2..679bdbd 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,9 @@
6+moc (1:2.6.0~svn-r3005-3.1ubuntu1) oracular; urgency=medium
7+
8+ * d/p/1000-ffmpeg-7.0.patch: add a patch to fix build with FFmpeg 7
9+
10+ -- Zixing Liu <zixing.liu@canonical.com> Tue, 17 Sep 2024 12:49:02 -0600
11+
12 moc (1:2.6.0~svn-r3005-3.1build5) noble; urgency=medium
13
14 * No-change rebuild for CVE-2024-3094
15diff --git a/debian/patches/1000-ffmpeg-7.0.patch b/debian/patches/1000-ffmpeg-7.0.patch
16new file mode 100644
17index 0000000..5329e0e
18--- /dev/null
19+++ b/debian/patches/1000-ffmpeg-7.0.patch
20@@ -0,0 +1,47 @@
21+Index: moc/decoder_plugins/ffmpeg/ffmpeg.c
22+===================================================================
23+--- moc.orig/decoder_plugins/ffmpeg/ffmpeg.c
24++++ moc/decoder_plugins/ffmpeg/ffmpeg.c
25+@@ -562,10 +562,10 @@ static bool is_seek_broken (struct ffmpe
26+ /* Downmix multi-channel audios to stereo. */
27+ static void set_downmixing (struct ffmpeg_data *data)
28+ {
29+- if (av_get_channel_layout_nb_channels (data->enc->channel_layout) <= 2)
30++ if ((data->enc->ch_layout.nb_channels) <= 2)
31+ return;
32+
33+- data->enc->request_channel_layout = AV_CH_LAYOUT_STEREO;
34++ av_channel_layout_from_mask(&data->enc->ch_layout, AV_CH_LAYOUT_STEREO);
35+ }
36+
37+ static int ffmpeg_io_read_cb (void *s, uint8_t *buf, int count)
38+@@ -1128,16 +1128,16 @@ static int decode_packet (struct ffmpeg_
39+ is_planar = av_sample_fmt_is_planar (data->enc->sample_fmt);
40+ packed = (char *)frame->extended_data[0];
41+ packed_size = frame->nb_samples * data->sample_width
42+- * data->enc->channels;
43++ * data->enc->ch_layout.nb_channels;
44+
45+- if (is_planar && data->enc->channels > 1) {
46++ if (is_planar && data->enc->ch_layout.nb_channels > 1) {
47+ int sample, ch;
48+
49+ packed = xmalloc (packed_size);
50+
51+ for (sample = 0; sample < frame->nb_samples; sample += 1) {
52+- for (ch = 0; ch < data->enc->channels; ch += 1)
53+- memcpy (packed + (sample * data->enc->channels + ch)
54++ for (ch = 0; ch < data->enc->ch_layout.nb_channels; ch += 1)
55++ memcpy (packed + (sample * data->enc->ch_layout.nb_channels + ch)
56+ * data->sample_width,
57+ (char *)frame->extended_data[ch] + sample * data->sample_width,
58+ data->sample_width);
59+@@ -1235,7 +1235,7 @@ static int ffmpeg_decode (void *prv_data
60+ return 0;
61+
62+ /* FFmpeg claims to always return native endian. */
63+- sound_params->channels = data->enc->channels;
64++ sound_params->channels = data->enc->ch_layout.nb_channels;
65+ sound_params->rate = data->enc->sample_rate;
66+ sound_params->fmt = data->fmt | SFMT_NE;
67+
68diff --git a/debian/patches/series b/debian/patches/series
69index 8cfe184..40209d7 100644
70--- a/debian/patches/series
71+++ b/debian/patches/series
72@@ -8,3 +8,4 @@
73 0008-Rename-configure.in-to-configure.ac.patch
74 0009-Add-https-to-is_url.patch
75 0010-ffmpeg-6.0.patch
76+1000-ffmpeg-7.0.patch

Subscribers

People subscribed via source and target branches

to all changes: