slackware-current/source/xap/freerdp/d0c5b1ae.patch

141 lines
5.6 KiB
Diff
Raw Normal View History

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 22:33:27 +02:00
From d0c5b1ae4289c7f3cde3fbc031cb4a3160df05ff Mon Sep 17 00:00:00 2001
From: Armin Novak <armin.novak@thincast.com>
Date: Wed, 7 Jun 2023 11:46:07 +0200
Subject: [PATCH] [codec,dsp] fix ffmpeg deprecations
---
libfreerdp/codec/dsp_ffmpeg.c | 54 +++++++++++++++++++++++++++--------
1 file changed, 42 insertions(+), 12 deletions(-)
diff --git a/libfreerdp/codec/dsp_ffmpeg.c b/libfreerdp/codec/dsp_ffmpeg.c
index 2c93a667750e..ebba52b147d2 100644
--- a/libfreerdp/codec/dsp_ffmpeg.c
+++ b/libfreerdp/codec/dsp_ffmpeg.c
@@ -224,18 +224,17 @@ static void ffmpeg_close_context(FREERDP_DSP_CONTEXT* context)
static BOOL ffmpeg_open_context(FREERDP_DSP_CONTEXT* context)
{
int ret;
- int layout;
- const AUDIO_FORMAT* format;
if (!context || context->isOpen)
return FALSE;
- format = &context->format;
+ const AUDIO_FORMAT* format = &context->format;
if (!format)
return FALSE;
-
- layout = av_get_default_channel_layout(format->nChannels);
+#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(57, 28, 100)
+ const int layout = av_get_default_channel_layout(format->nChannels);
+#endif
context->id = ffmpeg_get_avcodec(format);
if (ffmpeg_codec_is_filtered(context->id, context->encoder))
@@ -271,8 +270,12 @@ static BOOL ffmpeg_open_context(FREERDP_DSP_CONTEXT* context)
break;
}
+#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(57, 28, 100)
context->context->channels = format->nChannels;
context->context->channel_layout = layout;
+#else
+ av_channel_layout_default(&context->context->ch_layout, format->nChannels);
+#endif
context->context->sample_rate = format->nSamplesPerSec;
context->context->block_align = format->nBlockAlign;
context->context->bit_rate = format->nAvgBytesPerSec * 8;
@@ -315,8 +318,12 @@ static BOOL ffmpeg_open_context(FREERDP_DSP_CONTEXT* context)
if (!context->rcontext)
goto fail;
+#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(57, 28, 100)
context->frame->channel_layout = layout;
context->frame->channels = format->nChannels;
+#else
+ av_channel_layout_default(&context->frame->ch_layout, format->nChannels);
+#endif
context->frame->sample_rate = format->nSamplesPerSec;
context->frame->format = AV_SAMPLE_FMT_S16;
@@ -331,13 +338,21 @@ static BOOL ffmpeg_open_context(FREERDP_DSP_CONTEXT* context)
context->resampled->sample_rate = format->nSamplesPerSec;
}
+#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(57, 28, 100)
context->resampled->channel_layout = layout;
context->resampled->channels = format->nChannels;
+#else
+ av_channel_layout_default(&context->resampled->ch_layout, format->nChannels);
+#endif
if (context->context->frame_size > 0)
{
+#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(57, 28, 100)
context->buffered->channel_layout = context->resampled->channel_layout;
context->buffered->channels = context->resampled->channels;
+#else
+ av_channel_layout_copy(&context->buffered->ch_layout, &context->resampled->ch_layout);
+#endif
context->buffered->format = context->resampled->format;
context->buffered->nb_samples = context->context->frame_size;
@@ -458,14 +473,20 @@ static BOOL ffmpeg_fill_frame(AVFrame* frame, const AUDIO_FORMAT* inputFormat, c
size_t size)
{
int ret, bpp;
+#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(57, 28, 100)
frame->channels = inputFormat->nChannels;
+ frame->channel_layout = av_get_default_channel_layout(frame->channels);
+#else
+ av_channel_layout_default(&frame->ch_layout, inputFormat->nChannels);
+#endif
frame->sample_rate = inputFormat->nSamplesPerSec;
frame->format = ffmpeg_sample_format(inputFormat);
- frame->channel_layout = av_get_default_channel_layout(frame->channels);
+
bpp = av_get_bytes_per_sample(frame->format);
frame->nb_samples = size / inputFormat->nChannels / bpp;
- if ((ret = avcodec_fill_audio_frame(frame, frame->channels, frame->format, data, size, 1)) < 0)
+ if ((ret = avcodec_fill_audio_frame(frame, inputFormat->nChannels, frame->format, data, size,
+ 1)) < 0)
{
const char* err = av_err2str(ret);
WLog_ERR(TAG, "Error during audio frame fill %s [%d]", err, ret);
@@ -547,7 +568,12 @@ static BOOL ffmpeg_decode(AVCodecContext* dec_ctx, AVPacket* pkt, AVFrame* frame
}
{
- const size_t data_size = resampled->channels * resampled->nb_samples * 2;
+#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(57, 28, 100)
+ const size_t channels = resampled->channels;
+#else
+ const size_t channels = resampled->ch_layout.nb_channels;
+#endif
+ const size_t data_size = channels * resampled->nb_samples * 2;
Stream_EnsureRemainingCapacity(out, data_size);
Stream_Write(out, resampled->data[0], data_size);
}
@@ -745,10 +771,14 @@ BOOL freerdp_dsp_ffmpeg_encode(FREERDP_DSP_CONTEXT* context, const AUDIO_FORMAT*
if (inSamples + (int)context->bufferedSamples > context->context->frame_size)
inSamples = context->context->frame_size - (int)context->bufferedSamples;
- rc =
- av_samples_copy(context->buffered->extended_data, context->resampled->extended_data,
- (int)context->bufferedSamples, copied, inSamples,
- context->context->channels, context->context->sample_fmt);
+#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(57, 28, 100)
+ const int channels = context->context->channels;
+#else
+ const int channels = context->context->ch_layout.nb_channels;
+#endif
+ rc = av_samples_copy(context->buffered->extended_data,
+ context->resampled->extended_data, (int)context->bufferedSamples,
+ copied, inSamples, channels, context->context->sample_fmt);
rest -= inSamples;
copied += inSamples;
context->bufferedSamples += (UINT32)inSamples;