slackware-current/source/l/gegl/66de8124f496617eee8e6b5c68138a00343882db.patch
Patrick J Volkerding 3e4363cb32 Tue Aug 13 20:33:27 UTC 2024
ap/moc-2.6_alpha3-x86_64-4.txz:  Rebuilt.
  The ffmpeg7 patch isn't 100% there, so rebuild without the ffmpeg plugin.
ap/sqlite-3.46.1-x86_64-1.txz:  Upgraded.
kde/digikam-8.4.0-x86_64-2.txz:  Rebuilt.
  Recompiled against ffmpeg-7.0.2.
kde/ffmpegthumbs-23.08.5-x86_64-2.txz:  Rebuilt.
  Recompiled against ffmpeg-7.0.2.
kde/k3b-23.08.5-x86_64-2.txz:  Rebuilt.
  Recompiled against ffmpeg-7.0.2.
kde/kfilemetadata-5.116.0-x86_64-6.txz:  Rebuilt.
  Recompiled against ffmpeg-7.0.2.
kde/kpipewire-5.27.11-x86_64-2.txz:  Rebuilt.
  Recompiled against ffmpeg-7.0.2.
l/alsa-plugins-1.2.12-x86_64-2.txz:  Rebuilt.
  Recompiled against ffmpeg-7.0.2.
l/ffmpeg-7.0.2-x86_64-1.txz:  Upgraded.
  Shared library .so-version bump.
  Compiled against vulkan-sdk-1.3.290.0.
l/freetype-2.13.3-x86_64-1.txz:  Upgraded.
l/gegl-0.4.48-x86_64-2.txz:  Rebuilt.
  Recompiled against ffmpeg-7.0.2.
l/gst-plugins-bad-free-1.24.6-x86_64-2.txz:  Rebuilt.
  Recompiled against vulkan-sdk-1.3.290.0.
l/gst-plugins-libav-1.24.6-x86_64-2.txz:  Rebuilt.
  Recompiled against ffmpeg-7.0.2.
l/gtk4-4.14.4-x86_64-2.txz:  Rebuilt.
  Recompiled against vulkan-sdk-1.3.290.0.
l/libplacebo-7.349.0-x86_64-2.txz:  Rebuilt.
  Recompiled against vulkan-sdk-1.3.290.0.
l/mlt-7.24.0-x86_64-3.txz:  Rebuilt.
  Recompiled against ffmpeg-7.0.2.
l/opencv-4.10.0-x86_64-2.txz:  Rebuilt.
  Recompiled against ffmpeg-7.0.2.
l/pipewire-1.2.2-x86_64-2.txz:  Rebuilt.
  Recompiled against ffmpeg-7.0.2.
  Recompiled against vulkan-sdk-1.3.290.0.
l/qt5-5.15.14_20240716_ae0c8451-x86_64-2.txz:  Rebuilt.
  Recompiled against ffmpeg-7.0.2.
l/qt6-6.7.2_20240610_3f005f1e-x86_64-5.txz:  Rebuilt.
  Recompiled against ffmpeg-7.0.2.
l/spirv-llvm-translator-18.1.3-x86_64-2.txz:  Rebuilt.
  Recompiled against vulkan-sdk-1.3.290.0.
x/fcitx5-gtk-5.1.3-x86_64-2.txz:  Rebuilt.
  Recompiled against vulkan-sdk-1.3.290.0.
x/ibus-1.5.30-x86_64-2.txz:  Rebuilt.
  Recompiled against vulkan-sdk-1.3.290.0.
x/mesa-24.1.5-x86_64-2.txz:  Rebuilt.
  Recompiled against vulkan-sdk-1.3.290.0.
x/vulkan-sdk-1.3.290.0-x86_64-1.txz:  Upgraded.
xap/MPlayer-20240812-x86_64-1.txz:  Upgraded.
  Recompiled against ffmpeg-7.0.2.
xap/audacious-plugins-4.4-x86_64-3.txz:  Rebuilt.
  Recompiled against ffmpeg-7.0.2.
xap/ffmpegthumbnailer-2.2.2-x86_64-6.txz:  Rebuilt.
  Recompiled against ffmpeg-7.0.2.
xap/freerdp-2.11.7-x86_64-2.txz:  Rebuilt.
  Recompiled against ffmpeg-7.0.2.
xap/mpv-0.38.0-x86_64-5.txz:  Rebuilt.
  Recompiled against ffmpeg-7.0.2.
  Recompiled against vulkan-sdk-1.3.290.0.
xap/ssr-0.4.4-x86_64-3.txz:  Rebuilt.
  Recompiled against ffmpeg-7.0.2.
xap/xine-lib-1.2.13-x86_64-8.txz:  Rebuilt.
  Recompiled against ffmpeg-7.0.2.
xap/xscreensaver-6.09-x86_64-2.txz:  Rebuilt.
  Recompiled against ffmpeg-7.0.2.
2024-08-13 23:09:21 +02:00

113 lines
4.4 KiB
Diff

From 66de8124f496617eee8e6b5c68138a00343882db Mon Sep 17 00:00:00 2001
From: Joe Locash <@jlocash2>
Date: Sat, 4 May 2024 17:08:04 +0200
Subject: [PATCH] ff-load, ff-save: fix build with FFmpeg 7
Fixing issue #371
---
operations/external/ff-load.c | 8 ++++++++
operations/external/ff-save.c | 24 ++++++++++++++++++++++--
2 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/operations/external/ff-load.c b/operations/external/ff-load.c
index 6b96fdfdd..dc24a6d59 100644
--- a/operations/external/ff-load.c
+++ b/operations/external/ff-load.c
@@ -250,7 +250,11 @@ decode_audio (GeglOperation *operation,
while (samples_left)
{
int sample_count = samples_left;
+#if LIBAVCODEC_VERSION_MAJOR < 61
int channels = MIN(p->audio_stream->codecpar->channels, GEGL_MAX_AUDIO_CHANNELS);
+#else
+ int channels = MIN(p->audio_stream->codecpar->ch_layout.nb_channels, GEGL_MAX_AUDIO_CHANNELS);
+#endif
GeglAudioFragment *af = gegl_audio_fragment_new (o->audio_sample_rate, channels,
AV_CH_LAYOUT_STEREO, samples_left);
//);
@@ -553,7 +557,11 @@ prepare (GeglOperation *operation)
else
{
o->audio_sample_rate = p->audio_stream->codecpar->sample_rate;
+#if LIBAVCODEC_VERSION_MAJOR < 61
o->audio_channels = MIN(p->audio_stream->codecpar->channels, GEGL_MAX_AUDIO_CHANNELS);
+#else
+ o->audio_channels = MIN(p->audio_stream->codecpar->ch_layout.nb_channels, GEGL_MAX_AUDIO_CHANNELS);
+#endif
}
}
diff --git a/operations/external/ff-save.c b/operations/external/ff-save.c
index 9196b34aa..ffa5d8bee 100644
--- a/operations/external/ff-save.c
+++ b/operations/external/ff-save.c
@@ -315,8 +315,13 @@ add_audio_stream (GeglProperties *o, AVFormatContext * oc, int codec_id)
}
cp->sample_rate = o->audio_sample_rate;
+#if LIBAVCODEC_VERSION_MAJOR < 61
cp->channel_layout = AV_CH_LAYOUT_STEREO;
cp->channels = 2;
+#else
+ cp->ch_layout.u.mask = AV_CH_LAYOUT_STEREO;
+ cp->ch_layout.nb_channels = 2;
+#endif
return st;
}
@@ -392,8 +397,13 @@ static AVFrame *alloc_audio_frame(AVCodecContext *c, int nb_samples)
frame->format = c->sample_fmt;
+#if LIBAVCODEC_VERSION_MAJOR < 61
frame->channel_layout = c->channel_layout;
frame->channels = c->channels;
+#else
+ frame->ch_layout = c->ch_layout;
+ frame->ch_layout.nb_channels = c->ch_layout.nb_channels;
+#endif
frame->sample_rate = c->sample_rate;
frame->nb_samples = nb_samples;
@@ -423,8 +433,13 @@ static void encode_audio_fragments (Priv *p, AVFormatContext *oc, AVStream *st,
{
float left = 0, right = 0;
get_sample_data (p, i + p->audio_read_pos, &left, &right);
+#if LIBAVCODEC_VERSION_MAJOR < 61
((float*)frame->data[0])[c->channels*i+0] = left;
((float*)frame->data[0])[c->channels*i+1] = right;
+#else
+ ((float*)frame->data[0])[c->ch_layout.nb_channels*i+0] = left;
+ ((float*)frame->data[0])[c->ch_layout.nb_channels*i+1] = right;
+#endif
}
break;
case AV_SAMPLE_FMT_FLTP:
@@ -441,8 +456,13 @@ static void encode_audio_fragments (Priv *p, AVFormatContext *oc, AVStream *st,
{
float left = 0, right = 0;
get_sample_data (p, i + p->audio_read_pos, &left, &right);
+#if LIBAVCODEC_VERSION_MAJOR < 61
((int16_t*)frame->data[0])[c->channels*i+0] = left * (1<<15);
((int16_t*)frame->data[0])[c->channels*i+1] = right * (1<<15);
+#else
+ ((int16_t*)frame->data[0])[c->ch_layout.nb_channels*i+0] = left * (1<<15);
+ ((int16_t*)frame->data[0])[c->ch_layout.nb_channels*i+1] = right * (1<<15);
+#endif
}
break;
case AV_SAMPLE_FMT_S32:
@@ -450,8 +470,8 @@ static void encode_audio_fragments (Priv *p, AVFormatContext *oc, AVStream *st,
{
float left = 0, right = 0;
get_sample_data (p, i + p->audio_read_pos, &left, &right);
- ((int32_t*)frame->data[0])[c->channels*i+0] = left * (1<<31);
- ((int32_t*)frame->data[0])[c->channels*i+1] = right * (1<<31);
+ ((int32_t*)frame->data[0])[c->ch_layout.nb_channels*i+0] = left * (1<<31);
+ ((int32_t*)frame->data[0])[c->ch_layout.nb_channels*i+1] = right * (1<<31);
}
break;
case AV_SAMPLE_FMT_S32P:
--
GitLab