diff options
author | tytan652 | 2024-06-22 08:36:19 +0200 |
---|---|---|
committer | tytan652 | 2024-06-22 08:36:19 +0200 |
commit | 54e592e1f3150e3c597b2c97f860ff135c352b48 (patch) | |
tree | 39973e6ce4cd6cd45ac6196f448f7779c035e208 | |
parent | eb2e456aaf5dc46292d44dfd0f4d3dd49f254416 (diff) | |
download | aur-54e592e1f3150e3c597b2c97f860ff135c352b48.tar.gz |
build: Update to version 3.0.21
-rw-r--r-- | .SRCINFO | 20 | ||||
-rw-r--r-- | PKGBUILD | 16 | ||||
-rw-r--r-- | add-ffmpeg7-support.patch | 725 | ||||
-rw-r--r-- | fix-incompatible-pointer-types.patch | 177 |
4 files changed, 744 insertions, 194 deletions
@@ -1,7 +1,7 @@ pkgbase = vlc-luajit pkgdesc = Multi-platform MPEG, VCD/DVD, and DivX player built with luajit for OBS Studio compatibility - pkgver = 3.0.20 - pkgrel = 9 + pkgver = 3.0.21 + pkgrel = 1 url = https://www.videolan.org/vlc/ arch = x86_64 arch = aarch64 @@ -65,7 +65,7 @@ pkgbase = vlc-luajit makedepends = vcdimager makedepends = wayland-protocols makedepends = x264>=0.164 - makedepends = x265>=3.5 + makedepends = x265>=3.6 makedepends = xosd makedepends = zvbi makedepends = lua51 @@ -76,7 +76,7 @@ pkgbase = vlc-luajit depends = cairo depends = dbus depends = faad2 - depends = ffmpeg>=6 + depends = ffmpeg>=7 depends = fontconfig depends = freetype2 depends = fribidi @@ -179,21 +179,21 @@ pkgbase = vlc-luajit optdepends = twolame: TwoLAME mpeg2 encoder plugin optdepends = vcdimager: navigate VCD with libvcdinfo optdepends = x264>=0.164: H264 encoding - optdepends = x265>=3.5: HEVC/H.265 encoder + optdepends = x265>=3.6: HEVC/H.265 encoder optdepends = zvbi: VBI/Teletext/webcam/v4l2 capture/decoding - provides = vlc=3.0.20 + provides = vlc=3.0.21 conflicts = vlc conflicts = vlc-dev conflicts = vlc-plugin conflicts = vlc-stable-git options = !emptydirs - source = https://download.videolan.org/vlc/3.0.20/vlc-3.0.20.tar.xz + source = https://download.videolan.org/vlc/3.0.21/vlc-3.0.21.tar.xz source = update-vlc-plugin-cache.hook source = taglib-2.patch - source = fix-incompatible-pointer-types.patch - sha512sums = 02e58fb52dd75bf483ac4b298aecf86463b13d4782173d164adba6e4552d9262ff5e2ee1cbe1bce2c8a809801b79f328c6a8c475d34ae62aefaea02ae5ade406 + source = add-ffmpeg7-support.patch + sha512sums = cb1af76c8056648c331d7e6e0680d161ed1849eb635987504f45eae02531e9b432651034317fa7e02b0722905dfb9f0f5dad67b5924cc62edcaf0d173ac36aee sha512sums = b247510ffeadfd439a5dadd170c91900b6cdb05b5ca00d38b1a17c720ffe5a9f75a32e0cb1af5ebefdf1c23c5acc53513ed983a736e8fa30dd8fad237ef49dd3 sha512sums = ea0d1e1dfed16dac8f9027eb55d987dee59630568b9744ceb42bfa134ea9295252d83574f3d793a76a5be3b02661c1731ed366003b6b55b2d7f02fde70586ff3 - sha512sums = e41c99b08f85ee4e393fa9c7189f76edfe7160e3877d6f56e56de93d752bf15a28502de1417c0ed8008fa348a1e2480b9df0bd33acabe251df00ed2a92618740 + sha512sums = dc155f70ae6a800cea2fd8a9167c0fec0b67b695cbe5bf7bb7f1ca76247100ddb8493e7ce6a9ff5e35686d20b79408960a367156955fab892357bc1fb91e2bfe pkgname = vlc-luajit @@ -1,11 +1,11 @@ # Maintainer: tytan652 <tytan652[at]tytanium[dot]xyz> pkgname=vlc-luajit -_vlcver=3.0.20 +_vlcver=3.0.21 # optional fixup version including hyphen _vlcfixupver= pkgver=${_vlcver}${_vlcfixupver//-/.r} -pkgrel=9 +pkgrel=1 pkgdesc='Multi-platform MPEG, VCD/DVD, and DivX player built with luajit for OBS Studio compatibility' url='https://www.videolan.org/vlc/' arch=('x86_64' 'aarch64') @@ -28,7 +28,7 @@ _protobufver=25 _taglibver=2 _srtver=1.5 _x264ver=0.164 -_x265ver=3.5 +_x265ver=3.6 depends=( 'a52dec' "abseil-cpp>=$_abseilcppver" @@ -37,7 +37,7 @@ depends=( 'cairo' 'dbus' 'faad2' - "ffmpeg>=6" + "ffmpeg>=7" 'fontconfig' 'freetype2' 'fribidi' @@ -218,11 +218,11 @@ options=('!emptydirs') source=(https://download.videolan.org/${_name}/${_vlcver}/${_name}-${_vlcver}${_vlcfixupver}.tar.xz 'update-vlc-plugin-cache.hook' 'taglib-2.patch' - 'fix-incompatible-pointer-types.patch') # https://code.videolan.org/videolan/vlc/-/merge_requests/4645 -sha512sums=('02e58fb52dd75bf483ac4b298aecf86463b13d4782173d164adba6e4552d9262ff5e2ee1cbe1bce2c8a809801b79f328c6a8c475d34ae62aefaea02ae5ade406' + 'add-ffmpeg7-support.patch') # https://code.videolan.org/videolan/vlc/-/merge_requests/5574 +sha512sums=('cb1af76c8056648c331d7e6e0680d161ed1849eb635987504f45eae02531e9b432651034317fa7e02b0722905dfb9f0f5dad67b5924cc62edcaf0d173ac36aee' 'b247510ffeadfd439a5dadd170c91900b6cdb05b5ca00d38b1a17c720ffe5a9f75a32e0cb1af5ebefdf1c23c5acc53513ed983a736e8fa30dd8fad237ef49dd3' 'ea0d1e1dfed16dac8f9027eb55d987dee59630568b9744ceb42bfa134ea9295252d83574f3d793a76a5be3b02661c1731ed366003b6b55b2d7f02fde70586ff3' - 'e41c99b08f85ee4e393fa9c7189f76edfe7160e3877d6f56e56de93d752bf15a28502de1417c0ed8008fa348a1e2480b9df0bd33acabe251df00ed2a92618740') + 'dc155f70ae6a800cea2fd8a9167c0fec0b67b695cbe5bf7bb7f1ca76247100ddb8493e7ce6a9ff5e35686d20b79408960a367156955fab892357bc1fb91e2bfe') prepare() { cd ${_name}-${_vlcver} @@ -261,6 +261,8 @@ fi build() { cd ${_name}-${_vlcver} + export CFLAGS+=' -Wno-error=incompatible-pointer-types' + export CFLAGS+=" -I/usr/include/samba-4.0" export CPPFLAGS+=" -I/usr/include/samba-4.0 -ffat-lto-objects" export CXXFLAGS+=" -std=c++17" diff --git a/add-ffmpeg7-support.patch b/add-ffmpeg7-support.patch new file mode 100644 index 000000000000..cd9b6a08093b --- /dev/null +++ b/add-ffmpeg7-support.patch @@ -0,0 +1,725 @@ +From a4645b577c71e58db09ee6888f270fb3d0cfd61e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= <remi@remlab.net> +Date: Sat, 5 May 2018 15:28:15 +0300 +Subject: [PATCH 1/9] avcodec: avoid signedness mismatch warning + +Bitmask should be unsigned, but ffmpeg seems confused with itself. + +(cherry picked from commit 8544233e7fde2965435e32a445494898440ecc30) +--- + modules/codec/avcodec/audio.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c +index 50a76c7a18e1..e5af0ca5f2f8 100644 +--- a/modules/codec/avcodec/audio.c ++++ b/modules/codec/avcodec/audio.c +@@ -593,9 +593,9 @@ static void SetupOutputFormat( decoder_t *p_dec, bool b_trust ) + uint32_t pi_order_src[i_order_max]; + + int i_channels_src = 0; +- int64_t channel_layout = ++ uint64_t channel_layout = + p_sys->p_context->channel_layout ? p_sys->p_context->channel_layout : +- av_get_default_channel_layout( p_sys->p_context->channels ); ++ (uint64_t)av_get_default_channel_layout( p_sys->p_context->channels ); + + if( channel_layout ) + { +-- +GitLab + + +From 66a5827e2c711f91535802a74d34672a3efc6f8f Mon Sep 17 00:00:00 2001 +From: Ilkka Ollakka <ileoo@videolan.org> +Date: Wed, 5 Jul 2023 12:51:34 +0300 +Subject: [PATCH 2/9] avcodec: use p_dec->fmt_out instead of context channels + on audio channel-count + +reduces the need of ifdefs when adding ch_layout support + +(cherry picked from commit bddf5ba19111d1cc4463d9876c4bc4ba75f82d7f) +--- + modules/codec/avcodec/audio.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c +index e5af0ca5f2f8..26166c084e51 100644 +--- a/modules/codec/avcodec/audio.c ++++ b/modules/codec/avcodec/audio.c +@@ -484,15 +484,15 @@ static block_t * ConvertAVFrame( decoder_t *p_dec, AVFrame *frame ) + /* Interleave audio if required */ + if( av_sample_fmt_is_planar( ctx->sample_fmt ) ) + { +- p_block = block_Alloc(frame->linesize[0] * ctx->channels); ++ p_block = block_Alloc(frame->linesize[0] * p_dec->fmt_out.audio.i_channels ); + if ( likely(p_block) ) + { +- const void *planes[ctx->channels]; +- for (int i = 0; i < ctx->channels; i++) ++ const void *planes[p_dec->fmt_out.audio.i_channels]; ++ for (int i = 0; i < p_dec->fmt_out.audio.i_channels; i++) + planes[i] = frame->extended_data[i]; + + aout_Interleave(p_block->p_buffer, planes, frame->nb_samples, +- ctx->channels, p_dec->fmt_out.audio.i_format); ++ p_dec->fmt_out.audio.i_channels, p_dec->fmt_out.audio.i_format); + p_block->i_nb_samples = frame->nb_samples; + } + av_frame_free(&frame); +@@ -511,7 +511,7 @@ static block_t * ConvertAVFrame( decoder_t *p_dec, AVFrame *frame ) + { + aout_ChannelExtract( p_buffer->p_buffer, + p_dec->fmt_out.audio.i_channels, +- p_block->p_buffer, ctx->channels, ++ p_block->p_buffer, p_dec->fmt_out.audio.i_channels, + p_block->i_nb_samples, p_sys->pi_extraction, + p_dec->fmt_out.audio.i_bitspersample ); + p_buffer->i_nb_samples = p_block->i_nb_samples; +@@ -600,13 +600,13 @@ static void SetupOutputFormat( decoder_t *p_dec, bool b_trust ) + if( channel_layout ) + { + for( unsigned i = 0; i < i_order_max +- && i_channels_src < p_sys->p_context->channels; i++ ) ++ && i_channels_src < p_dec->fmt_out.audio.i_channels; i++ ) + { + if( channel_layout & pi_channels_map[i][0] ) + pi_order_src[i_channels_src++] = pi_channels_map[i][1]; + } + +- if( i_channels_src != p_sys->p_context->channels && b_trust ) ++ if( i_channels_src != p_dec->fmt_out.audio.i_channels && b_trust ) + msg_Err( p_dec, "Channel layout not understood" ); + + /* Detect special dual mono case */ +-- +GitLab + + +From 2cac4b6721d10c43a30c8b93a98244c7294c9dd2 Mon Sep 17 00:00:00 2001 +From: Ilkka Ollakka <ileoo@videolan.org> +Date: Wed, 5 Jul 2023 13:33:09 +0300 +Subject: [PATCH 3/9] avcodec: audio decoder to use ch_layout + +(cherry picked from commit 496f0f2a659c1339d1e37330d446e9b6ce96e76b) +--- + modules/codec/avcodec/audio.c | 58 +++++++++++++++++++++++++---------- + 1 file changed, 42 insertions(+), 16 deletions(-) + +diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c +index 26166c084e51..f97415a657fd 100644 +--- a/modules/codec/avcodec/audio.c ++++ b/modules/codec/avcodec/audio.c +@@ -71,7 +71,7 @@ struct decoder_sys_t + #define BLOCK_FLAG_PRIVATE_REALLOCATED (1 << BLOCK_FLAG_PRIVATE_SHIFT) + + static void SetupOutputFormat( decoder_t *p_dec, bool b_trust ); +-static block_t * ConvertAVFrame( decoder_t *p_dec, AVFrame *frame ); ++static block_t * ConvertAVFrame( decoder_t *p_dec, AVFrame *frame, int ); + static int DecodeAudio( decoder_t *, block_t * ); + static void Flush( decoder_t * ); + +@@ -139,7 +139,11 @@ static int OpenAudioCodec( decoder_t *p_dec ) + } + + ctx->sample_rate = p_dec->fmt_in.audio.i_rate; ++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59, 24, 100) && LIBAVCODEC_VERSION_MICRO >= 100 ++ av_channel_layout_default( &ctx->ch_layout, p_dec->fmt_in.audio.i_channels ); ++#else + ctx->channels = p_dec->fmt_in.audio.i_channels; ++#endif + ctx->block_align = p_dec->fmt_in.audio.i_blockalign; + ctx->bit_rate = p_dec->fmt_in.i_bitrate; + ctx->bits_per_coded_sample = p_dec->fmt_in.audio.i_bitspersample; +@@ -395,12 +399,17 @@ static int DecodeBlock( decoder_t *p_dec, block_t **pp_block ) + ret = avcodec_receive_frame( ctx, frame ); + if( ret == 0 ) + { ++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59, 24, 100) && LIBAVCODEC_VERSION_MICRO >= 100 ++ int channels = frame->ch_layout.nb_channels; ++#else ++ int channels = ctx->channels; ++#endif + /* checks and init from first decoded frame */ +- if( ctx->channels <= 0 || ctx->channels > INPUT_CHAN_MAX ++ if( channels <= 0 || channels > INPUT_CHAN_MAX + || ctx->sample_rate <= 0 ) + { + msg_Warn( p_dec, "invalid audio properties channels count %d, sample rate %d", +- ctx->channels, ctx->sample_rate ); ++ channels, ctx->sample_rate ); + goto drop; + } + else if( p_dec->fmt_out.audio.i_rate != (unsigned int)ctx->sample_rate ) +@@ -412,7 +421,7 @@ static int DecodeBlock( decoder_t *p_dec, block_t **pp_block ) + if( decoder_UpdateAudioFormat( p_dec ) ) + goto drop; + +- block_t *p_converted = ConvertAVFrame( p_dec, frame ); /* Consumes frame */ ++ block_t *p_converted = ConvertAVFrame( p_dec, frame, channels ); /* Consumes frame */ + if( p_converted ) + { + /* Silent unwanted samples */ +@@ -475,7 +484,7 @@ static int DecodeAudio( decoder_t *p_dec, block_t *p_block ) + return i_ret; + } + +-static block_t * ConvertAVFrame( decoder_t *p_dec, AVFrame *frame ) ++static block_t * ConvertAVFrame( decoder_t *p_dec, AVFrame *frame, int channels ) + { + decoder_sys_t *p_sys = p_dec->p_sys; + AVCodecContext *ctx = p_sys->p_context; +@@ -484,15 +493,15 @@ static block_t * ConvertAVFrame( decoder_t *p_dec, AVFrame *frame ) + /* Interleave audio if required */ + if( av_sample_fmt_is_planar( ctx->sample_fmt ) ) + { +- p_block = block_Alloc(frame->linesize[0] * p_dec->fmt_out.audio.i_channels ); ++ p_block = block_Alloc(frame->linesize[0] * channels); + if ( likely(p_block) ) + { +- const void *planes[p_dec->fmt_out.audio.i_channels]; +- for (int i = 0; i < p_dec->fmt_out.audio.i_channels; i++) ++ const void *planes[channels]; ++ for (int i = 0; i < channels; i++) + planes[i] = frame->extended_data[i]; + + aout_Interleave(p_block->p_buffer, planes, frame->nb_samples, +- p_dec->fmt_out.audio.i_channels, p_dec->fmt_out.audio.i_format); ++ channels, p_dec->fmt_out.audio.i_format); + p_block->i_nb_samples = frame->nb_samples; + } + av_frame_free(&frame); +@@ -511,7 +520,7 @@ static block_t * ConvertAVFrame( decoder_t *p_dec, AVFrame *frame ) + { + aout_ChannelExtract( p_buffer->p_buffer, + p_dec->fmt_out.audio.i_channels, +- p_block->p_buffer, p_dec->fmt_out.audio.i_channels, ++ p_block->p_buffer, channels, + p_block->i_nb_samples, p_sys->pi_extraction, + p_dec->fmt_out.audio.i_bitspersample ); + p_buffer->i_nb_samples = p_block->i_nb_samples; +@@ -580,6 +589,16 @@ static void SetupOutputFormat( decoder_t *p_dec, bool b_trust ) + p_dec->fmt_out.audio.i_rate = p_sys->p_context->sample_rate; + + /* */ ++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59, 24, 100) && LIBAVCODEC_VERSION_MICRO >= 100 ++ if( p_sys->i_previous_channels == p_sys->p_context->ch_layout.nb_channels && ++ p_sys->i_previous_layout == p_sys->p_context->ch_layout.u.mask ) ++ return; ++ if( b_trust ) ++ { ++ p_sys->i_previous_channels = p_sys->p_context->ch_layout.nb_channels; ++ p_sys->i_previous_layout = p_sys->p_context->ch_layout.u.mask; ++ } ++#else + if( p_sys->i_previous_channels == p_sys->p_context->channels && + p_sys->i_previous_layout == p_sys->p_context->channel_layout ) + return; +@@ -588,25 +607,32 @@ static void SetupOutputFormat( decoder_t *p_dec, bool b_trust ) + p_sys->i_previous_channels = p_sys->p_context->channels; + p_sys->i_previous_layout = p_sys->p_context->channel_layout; + } ++#endif + + const unsigned i_order_max = sizeof(pi_channels_map)/sizeof(*pi_channels_map); + uint32_t pi_order_src[i_order_max]; + + int i_channels_src = 0; +- uint64_t channel_layout = ++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59, 24, 100) && LIBAVCODEC_VERSION_MICRO >= 100 ++ uint64_t channel_layout_mask = p_sys->p_context->ch_layout.u.mask; ++ int channel_count = p_sys->p_context->ch_layout.nb_channels; ++#else ++ uint64_t channel_layout_mask = + p_sys->p_context->channel_layout ? p_sys->p_context->channel_layout : + (uint64_t)av_get_default_channel_layout( p_sys->p_context->channels ); ++ int channel_count = p_sys->p_context->channels; ++#endif + +- if( channel_layout ) ++ if( channel_layout_mask ) + { + for( unsigned i = 0; i < i_order_max +- && i_channels_src < p_dec->fmt_out.audio.i_channels; i++ ) ++ && i_channels_src < channel_count; i++ ) + { +- if( channel_layout & pi_channels_map[i][0] ) ++ if( channel_layout_mask & pi_channels_map[i][0] ) + pi_order_src[i_channels_src++] = pi_channels_map[i][1]; + } + +- if( i_channels_src != p_dec->fmt_out.audio.i_channels && b_trust ) ++ if( i_channels_src != channel_count && b_trust ) + msg_Err( p_dec, "Channel layout not understood" ); + + /* Detect special dual mono case */ +@@ -638,7 +664,7 @@ static void SetupOutputFormat( decoder_t *p_dec, bool b_trust ) + { + msg_Warn( p_dec, "no channel layout found"); + p_dec->fmt_out.audio.i_physical_channels = 0; +- p_dec->fmt_out.audio.i_channels = p_sys->p_context->channels; ++ p_dec->fmt_out.audio.i_channels = channel_count; + } + + aout_FormatPrepare( &p_dec->fmt_out.audio ); +-- +GitLab + + +From 21c64cff52ed8ef9b567be408bbd000e722aed7f Mon Sep 17 00:00:00 2001 +From: Ilkka Ollakka <ileoo@videolan.org> +Date: Tue, 4 Jul 2023 16:52:38 +0300 +Subject: [PATCH 4/9] avcodec: use p_enc audio channels instead of context + channels in encoder + +Allows to have less conditions in code when adding new ch_layout use +--- + modules/codec/avcodec/encoder.c | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c +index 4919ccf0e0e4..52848de06587 100644 +--- a/modules/codec/avcodec/encoder.c ++++ b/modules/codec/avcodec/encoder.c +@@ -790,7 +790,7 @@ int InitVideoEnc( vlc_object_t *p_this ) + } + } + } +- if( i_channels_src != p_context->channels ) ++ if( i_channels_src != p_enc->fmt_out.audio.i_channels ) + msg_Err( p_enc, "Channel layout not understood" ); + + p_sys->i_channels_to_reorder = +@@ -897,7 +897,7 @@ int InitVideoEnc( vlc_object_t *p_this ) + if( ret ) + { + if( p_enc->fmt_in.i_cat != AUDIO_ES || +- (p_context->channels <= 2 && i_codec_id != AV_CODEC_ID_MP2 ++ (p_enc->fmt_out.audio.i_channels <= 2 && i_codec_id != AV_CODEC_ID_MP2 + && i_codec_id != AV_CODEC_ID_MP3) ) + errmsg: + { +@@ -922,7 +922,7 @@ errmsg: + goto error; + } + +- if( p_context->channels > 2 ) ++ if( p_enc->fmt_out.audio.i_channels > 2 ) + { + p_context->channels = 2; + p_context->channel_layout = channel_mask[p_context->channels][1]; +@@ -1028,7 +1028,7 @@ errmsg: + p_context->frame_size : + AV_INPUT_BUFFER_MIN_SIZE; + p_sys->i_buffer_out = av_samples_get_buffer_size(NULL, +- p_sys->p_context->channels, p_sys->i_frame_size, ++ p_enc->fmt_out.audio.i_channels, p_sys->i_frame_size, + p_sys->p_context->sample_fmt, DEFAULT_ALIGN); + p_sys->p_buffer = av_malloc( p_sys->i_buffer_out ); + if ( unlikely( p_sys->p_buffer == NULL ) ) +@@ -1278,7 +1278,7 @@ static block_t *handle_delay_buffer( encoder_t *p_enc, encoder_sys_t *p_sys, uns + { + block_t *p_block = NULL; + //How much we need to copy from new packet +- const size_t leftover = leftover_samples * p_sys->p_context->channels * p_sys->i_sample_bytes; ++ const size_t leftover = leftover_samples * p_enc->fmt_out.audio.i_channels * p_sys->i_sample_bytes; + + av_frame_unref( p_sys->frame ); + p_sys->frame->format = p_sys->p_context->sample_fmt; +@@ -1301,7 +1301,7 @@ static block_t *handle_delay_buffer( encoder_t *p_enc, encoder_sys_t *p_sys, uns + // We need to deinterleave from p_aout_buf to p_buffer the leftover bytes + if( p_sys->b_planar ) + aout_Deinterleave( p_sys->p_interleave_buf, p_sys->p_buffer, +- p_sys->i_frame_size, p_sys->p_context->channels, p_enc->fmt_in.i_codec ); ++ p_sys->i_frame_size, p_enc->fmt_out.audio.i_channels, p_enc->fmt_in.i_codec ); + else + memcpy( p_sys->p_buffer + buffer_delay, p_aout_buf->p_buffer, leftover); + +@@ -1319,7 +1319,7 @@ static block_t *handle_delay_buffer( encoder_t *p_enc, encoder_sys_t *p_sys, uns + memset( p_sys->p_buffer + (leftover+buffer_delay), 0, padding_size ); + buffer_delay += padding_size; + } +- if( avcodec_fill_audio_frame( p_sys->frame, p_sys->p_context->channels, ++ if( avcodec_fill_audio_frame( p_sys->frame, p_enc->fmt_out.audio.i_channels, + p_sys->p_context->sample_fmt, p_sys->b_planar ? p_sys->p_interleave_buf : p_sys->p_buffer, + p_sys->i_buffer_out, + DEFAULT_ALIGN) < 0 ) +@@ -1349,7 +1349,7 @@ static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_aout_buf ) + + //i_bytes_left is amount of bytes we get + i_samples_left = p_aout_buf ? p_aout_buf->i_nb_samples : 0; +- buffer_delay = p_sys->i_samples_delay * p_sys->i_sample_bytes * p_sys->p_context->channels; ++ buffer_delay = p_sys->i_samples_delay * p_sys->i_sample_bytes * p_enc->fmt_out.audio.i_channels; + + //p_sys->i_buffer_out = p_sys->i_frame_size * chan * p_sys->i_sample_bytes + //Calculate how many bytes we would need from current buffer to fill frame +@@ -1418,12 +1418,12 @@ static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_aout_buf ) + p_sys->frame->channels = p_sys->p_context->channels; + + const int in_bytes = p_sys->frame->nb_samples * +- p_sys->p_context->channels * p_sys->i_sample_bytes; ++ p_enc->fmt_out.audio.i_channels* p_sys->i_sample_bytes; + + if( p_sys->b_planar ) + { + aout_Deinterleave( p_sys->p_buffer, p_aout_buf->p_buffer, +- p_sys->frame->nb_samples, p_sys->p_context->channels, p_enc->fmt_in.i_codec ); ++ p_sys->frame->nb_samples, p_enc->fmt_out.audio.i_channels, p_enc->fmt_in.i_codec ); + + } + else +@@ -1431,7 +1431,7 @@ static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_aout_buf ) + memcpy(p_sys->p_buffer, p_aout_buf->p_buffer, in_bytes); + } + +- if( avcodec_fill_audio_frame( p_sys->frame, p_sys->p_context->channels, ++ if( avcodec_fill_audio_frame( p_sys->frame, p_enc->fmt_out.audio.i_channels, + p_sys->p_context->sample_fmt, + p_sys->p_buffer, + p_sys->i_buffer_out, +@@ -1457,7 +1457,7 @@ static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_aout_buf ) + if( p_aout_buf->i_nb_samples > 0 ) + { + memcpy( p_sys->p_buffer + buffer_delay, p_aout_buf->p_buffer, +- p_aout_buf->i_nb_samples * p_sys->i_sample_bytes * p_sys->p_context->channels); ++ p_aout_buf->i_nb_samples * p_sys->i_sample_bytes * p_enc->fmt_out.audio.i_channels); + p_sys->i_samples_delay += p_aout_buf->i_nb_samples; + } + +-- +GitLab + + +From f8be7809d0ce56f97cf860cc1d0f4e54826d5fb4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fran=C3=A7ois=20Cartegnie?= <fcvlcdev@free.fr> +Date: Tue, 23 Apr 2024 13:13:30 +0700 +Subject: [PATCH 5/9] codec: avcodec: map AYUV as RAWVIDEO with ffmpeg 6.0 + +(cherry picked from commit 955ef939467a628eb8da08e0d5eaefc9a3484cba) +--- + modules/codec/avcodec/fourcc.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/modules/codec/avcodec/fourcc.c b/modules/codec/avcodec/fourcc.c +index 33c6cae09abc..97f3188211d3 100644 +--- a/modules/codec/avcodec/fourcc.c ++++ b/modules/codec/avcodec/fourcc.c +@@ -182,8 +182,12 @@ static const struct vlc_avcodec_fourcc video_codecs[] = + /* AV_CODEC_ID_V210X */ + { VLC_CODEC_TMV, AV_CODEC_ID_TMV }, + { VLC_CODEC_V210, AV_CODEC_ID_V210 }, +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 54, 50, 100 ) && LIBAVCODEC_VERSION_MICRO >= 100 ++#if LIBAVCODEC_VERSION_MICRO >= 100 ++# if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 59, 42, 102 ) ++ { VLC_CODEC_VUYA, AV_CODEC_ID_RAWVIDEO }, ++# elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 54, 50, 100 ) + { VLC_CODEC_VUYA, AV_CODEC_ID_AYUV }, ++# endif + #endif + /* AV_CODEC_ID_DPX */ + { VLC_CODEC_MAD, AV_CODEC_ID_MAD }, +-- +GitLab + + +From 1b7965da979fd281fd98950566e9f5e156f0977f Mon Sep 17 00:00:00 2001 +From: Francois Cartegnie <fcvlcdev@free.fr> +Date: Thu, 13 Jun 2024 12:21:58 +0700 +Subject: [PATCH 6/9] avcodec: encoder: fix channel_layout conditionals + +--- + modules/codec/avcodec/encoder.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c +index 52848de06587..6bd58f5071d2 100644 +--- a/modules/codec/avcodec/encoder.c ++++ b/modules/codec/avcodec/encoder.c +@@ -43,12 +43,13 @@ + #include <vlc_cpu.h> + + #include <libavcodec/avcodec.h> +-#include <libavutil/channel_layout.h> + + #include "avcodec.h" + #include "avcommon.h" + +-#if LIBAVUTIL_VERSION_CHECK( 52,2,6,0,0 ) ++#define API_CHANNEL_LAYOUT (LIBAVUTIL_VERSION_CHECK( 52, 2, 6, 0, 100)) ++ ++#if API_CHANNEL_LAYOUT + # include <libavutil/channel_layout.h> + #endif + +@@ -157,6 +158,7 @@ struct encoder_sys_t + + + /* Taken from audio.c*/ ++#if API_CHANNEL_LAYOUT + static const uint64_t pi_channels_map[][2] = + { + { AV_CH_FRONT_LEFT, AOUT_CHAN_LEFT }, +@@ -193,6 +195,7 @@ static const uint32_t channel_mask[][2] = { + {AOUT_CHANS_7_1, AV_CH_LAYOUT_7POINT1}, + {AOUT_CHANS_8_1, AV_CH_LAYOUT_OCTAGONAL}, + }; ++#endif + + static const char *const ppsz_enc_options[] = { + "keyint", "bframes", "vt", "qmin", "qmax", "codec", "hq", +@@ -746,7 +749,7 @@ int InitVideoEnc( vlc_object_t *p_this ) + p_context->time_base.num = 1; + p_context->time_base.den = p_context->sample_rate; + p_context->channels = p_enc->fmt_out.audio.i_channels; +-#if LIBAVUTIL_VERSION_CHECK( 52, 2, 6, 0, 0) ++#if API_CHANNEL_LAYOUT + p_context->channel_layout = channel_mask[p_context->channels][1]; + + /* Setup Channel ordering for multichannel audio +@@ -925,7 +928,9 @@ errmsg: + if( p_enc->fmt_out.audio.i_channels > 2 ) + { + p_context->channels = 2; ++#if API_CHANNEL_LAYOUT + p_context->channel_layout = channel_mask[p_context->channels][1]; ++#endif + + /* Change fmt_in in order to ask for a channels conversion */ + p_enc->fmt_in.audio.i_channels = +-- +GitLab + + +From 6dd757878ef89edbb3d8f91b5689c61a379d2950 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fran=C3=A7ois=20Cartegnie?= <fcvlcdev@free.fr> +Date: Tue, 23 Apr 2024 13:14:53 +0700 +Subject: [PATCH 7/9] demux/mux: avformat: use ch_layout from ffmpeg 5.1 + +(cherry picked from commit a55ec32ab3760d9edb6f05481cd3a981aa42878d) +--- + modules/demux/avformat/demux.c | 4 ++++ + modules/demux/avformat/mux.c | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c +index 3b355bb3faec..830dc0157e2b 100644 +--- a/modules/demux/avformat/demux.c ++++ b/modules/demux/avformat/demux.c +@@ -401,7 +401,11 @@ int avformat_OpenDemux( vlc_object_t *p_this ) + es_format_Init( &es_fmt, AUDIO_ES, fcc ); + es_fmt.i_original_fourcc = CodecTagToFourcc( cp->codec_tag ); + es_fmt.i_bitrate = cp->bit_rate; ++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 59, 24, 100 ) && LIBAVCODEC_VERSION_MICRO >= 100 ++ es_fmt.audio.i_channels = cp->ch_layout.nb_channels; ++#else + es_fmt.audio.i_channels = cp->channels; ++#endif + es_fmt.audio.i_rate = cp->sample_rate; + es_fmt.audio.i_bitspersample = cp->bits_per_coded_sample; + es_fmt.audio.i_blockalign = cp->block_align; +diff --git a/modules/demux/avformat/mux.c b/modules/demux/avformat/mux.c +index c708276954ce..8bf8735885f5 100644 +--- a/modules/demux/avformat/mux.c ++++ b/modules/demux/avformat/mux.c +@@ -267,7 +267,11 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) + { + case AUDIO_ES: + codecpar->codec_type = AVMEDIA_TYPE_AUDIO; ++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 59, 24, 100 ) && LIBAVCODEC_VERSION_MICRO >= 100 ++ av_channel_layout_default( &codecpar->ch_layout, fmt->audio.i_channels ); ++#else + codecpar->channels = fmt->audio.i_channels; ++#endif + codecpar->sample_rate = fmt->audio.i_rate; + stream->time_base = (AVRational){1, codecpar->sample_rate}; + if (fmt->i_bitrate == 0) { +-- +GitLab + + +From fac371d8fcad0b176f1bd7ac5f0c74c548b5d273 Mon Sep 17 00:00:00 2001 +From: Ilkka Ollakka <ileoo@videolan.org> +Date: Tue, 4 Jul 2023 16:53:43 +0300 +Subject: [PATCH 8/9] avcodec: add handling of new ch_layout in audio encoder + +conditioned to avcodec version where is it added + +(cherry picked from commit c4302ca59dd79efd7208a45a3fcdc44388fd03a8) +--- + modules/codec/avcodec/encoder.c | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c +index 6bd58f5071d2..71b9d55ce6e9 100644 +--- a/modules/codec/avcodec/encoder.c ++++ b/modules/codec/avcodec/encoder.c +@@ -48,6 +48,7 @@ + #include "avcommon.h" + + #define API_CHANNEL_LAYOUT (LIBAVUTIL_VERSION_CHECK( 52, 2, 6, 0, 100)) ++#define API_CHANNEL_LAYOUT_STRUCT (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59, 24, 100) && LIBAVCODEC_VERSION_MICRO >= 100) + + #if API_CHANNEL_LAYOUT + # include <libavutil/channel_layout.h> +@@ -927,11 +928,14 @@ errmsg: + + if( p_enc->fmt_out.audio.i_channels > 2 ) + { ++#if API_CHANNEL_LAYOUT_STRUCT ++ av_channel_layout_default( &p_context->ch_layout, 2 ); ++#else + p_context->channels = 2; +-#if API_CHANNEL_LAYOUT ++# if API_CHANNEL_LAYOUT + p_context->channel_layout = channel_mask[p_context->channels][1]; ++# endif + #endif +- + /* Change fmt_in in order to ask for a channels conversion */ + p_enc->fmt_in.audio.i_channels = + p_enc->fmt_out.audio.i_channels = 2; +@@ -1288,8 +1292,12 @@ static block_t *handle_delay_buffer( encoder_t *p_enc, encoder_sys_t *p_sys, uns + av_frame_unref( p_sys->frame ); + p_sys->frame->format = p_sys->p_context->sample_fmt; + p_sys->frame->nb_samples = leftover_samples + p_sys->i_samples_delay; ++#if API_CHANNEL_LAYOUT_STRUCT ++ av_channel_layout_copy(&p_sys->frame->ch_layout, &p_sys->p_context->ch_layout); ++#else + p_sys->frame->channel_layout = p_sys->p_context->channel_layout; + p_sys->frame->channels = p_sys->p_context->channels; ++#endif + + p_sys->frame->pts = date_Get( &p_sys->buffer_date ) * p_sys->p_context->time_base.den / + CLOCK_FREQ / p_sys->p_context->time_base.num; +@@ -1419,8 +1427,12 @@ static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_aout_buf ) + p_sys->frame->pts = date_Get( &p_sys->buffer_date ) * p_sys->p_context->time_base.den / + CLOCK_FREQ / p_sys->p_context->time_base.num; + ++#if API_CHANNEL_LAYOUT_STRUCT ++ av_channel_layout_copy(&p_sys->frame->ch_layout, &p_sys->p_context->ch_layout); ++#else + p_sys->frame->channel_layout = p_sys->p_context->channel_layout; + p_sys->frame->channels = p_sys->p_context->channels; ++#endif + + const int in_bytes = p_sys->frame->nb_samples * + p_enc->fmt_out.audio.i_channels* p_sys->i_sample_bytes; +-- +GitLab + + +From 280078b68b30571d67186341513f161cc383e759 Mon Sep 17 00:00:00 2001 +From: Ilkka Ollakka <ileoo@videolan.org> +Date: Tue, 4 Jul 2023 16:55:28 +0300 +Subject: [PATCH 9/9] avcodec: use ch_layout for channel layout in audio + encoder + +channels and channel_layout has been deprecated in FFMPEG 5.1 and will be removed eventually + +also always create the mapping, as ch_layout is always there + +(cherry picked from commit b73dc8841d999c6be9de718cd2cd3aeb13279792) +--- + modules/codec/avcodec/encoder.c | 53 ++++++++++++++------------------- + 1 file changed, 22 insertions(+), 31 deletions(-) + +diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c +index 71b9d55ce6e9..091086b03e53 100644 +--- a/modules/codec/avcodec/encoder.c ++++ b/modules/codec/avcodec/encoder.c +@@ -184,6 +184,7 @@ static const uint64_t pi_channels_map[][2] = + { AV_CH_STEREO_RIGHT, 0 }, + }; + ++# if !API_CHANNEL_LAYOUT_STRUCT + static const uint32_t channel_mask[][2] = { + {0,0}, + {AOUT_CHAN_CENTER, AV_CH_LAYOUT_MONO}, +@@ -196,6 +197,7 @@ static const uint32_t channel_mask[][2] = { + {AOUT_CHANS_7_1, AV_CH_LAYOUT_7POINT1}, + {AOUT_CHANS_8_1, AV_CH_LAYOUT_OCTAGONAL}, + }; ++# endif + #endif + + static const char *const ppsz_enc_options[] = { +@@ -749,49 +751,36 @@ int InitVideoEnc( vlc_object_t *p_this ) + date_Set( &p_sys->buffer_date, AV_NOPTS_VALUE ); + p_context->time_base.num = 1; + p_context->time_base.den = p_context->sample_rate; +- p_context->channels = p_enc->fmt_out.audio.i_channels; +-#if API_CHANNEL_LAYOUT +- p_context->channel_layout = channel_mask[p_context->channels][1]; + +- /* Setup Channel ordering for multichannel audio ++ /* Setup Channel ordering for audio + * as VLC channel order isn't same as libavcodec expects + */ + + p_sys->i_channels_to_reorder = 0; + +- /* Specified order ++ /* Create channel layout for avcodec + * Copied from audio.c + */ +- const unsigned i_order_max = 8 * sizeof(p_context->channel_layout); +- uint32_t pi_order_dst[AOUT_CHAN_MAX] = { }; ++#if API_CHANNEL_LAYOUT ++ uint32_t pi_order_dst[AOUT_CHAN_MAX] = { 0 }; + uint32_t order_mask = 0; + int i_channels_src = 0; +- +- if( p_context->channel_layout ) +- { +- msg_Dbg( p_enc, "Creating channel order for reordering"); +- for( unsigned i = 0; i < sizeof(pi_channels_map)/sizeof(*pi_channels_map); i++ ) +- { +- if( p_context->channel_layout & pi_channels_map[i][0] ) +- { +- msg_Dbg( p_enc, "%d %"PRIx64" mapped to %"PRIx64"", i_channels_src, pi_channels_map[i][0], pi_channels_map[i][1]); +- pi_order_dst[i_channels_src++] = pi_channels_map[i][1]; +- order_mask |= pi_channels_map[i][1]; +- } +- } +- } +- else ++ msg_Dbg( p_enc, "Creating channel order for reordering"); ++# if API_CHANNEL_LAYOUT_STRUCT ++ av_channel_layout_default( &p_context->ch_layout, p_enc->fmt_out.audio.i_channels ); ++ uint64_t channel_mask = p_context->ch_layout.u.mask; ++# else ++ p_context->channels = p_enc->fmt_out.audio.i_channels; ++ p_context->channel_layout = channel_mask[p_context->channels][1]; ++ uint64_t channel_mask = p_context->channel_layout; ++# endif ++ for( unsigned i = 0; i < sizeof(pi_channels_map)/sizeof(*pi_channels_map); i++ ) + { +- msg_Dbg( p_enc, "Creating default channel order for reordering"); +- /* Create default order */ +- for( unsigned int i = 0; i < __MIN( i_order_max, (unsigned)p_sys->p_context->channels ); i++ ) ++ if( channel_mask & pi_channels_map[i][0] ) + { +- if( i < sizeof(pi_channels_map)/sizeof(*pi_channels_map) ) +- { +- msg_Dbg( p_enc, "%d channel is %"PRIx64"", i_channels_src, pi_channels_map[i][1]); +- pi_order_dst[i_channels_src++] = pi_channels_map[i][1]; +- order_mask |= pi_channels_map[i][1]; +- } ++ msg_Dbg( p_enc, "%d %"PRIx64" mapped to %"PRIx64"", i_channels_src, pi_channels_map[i][0], pi_channels_map[i][1]); ++ pi_order_dst[i_channels_src++] = pi_channels_map[i][1]; ++ order_mask |= pi_channels_map[i][1]; + } + } + if( i_channels_src != p_enc->fmt_out.audio.i_channels ) +@@ -800,6 +789,8 @@ int InitVideoEnc( vlc_object_t *p_this ) + p_sys->i_channels_to_reorder = + aout_CheckChannelReorder( NULL, pi_order_dst, order_mask, + p_sys->pi_reorder_layout ); ++#else ++ p_context->channels = p_enc->fmt_out.audio.i_channels; + #endif + + if ( p_enc->fmt_out.i_codec == VLC_CODEC_MP4A ) +-- +GitLab + diff --git a/fix-incompatible-pointer-types.patch b/fix-incompatible-pointer-types.patch deleted file mode 100644 index bd26976fbc74..000000000000 --- a/fix-incompatible-pointer-types.patch +++ /dev/null @@ -1,177 +0,0 @@ -From 1e2918115ca2f5c4ffde00dc02ad89525714f6c2 Mon Sep 17 00:00:00 2001 -From: Thomas Guillem <thomas@gllm.fr> -Date: Tue, 5 Dec 2023 09:23:35 +0100 -Subject: [PATCH 1/5] input: fix incompatible-pointer-types assignment - -Fixes #28441 ---- - src/input/input_internal.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/input/input_internal.h b/src/input/input_internal.h -index d29731edca1b..ea02f39f5add 100644 ---- a/src/input/input_internal.h -+++ b/src/input/input_internal.h -@@ -117,7 +117,7 @@ typedef struct input_thread_private_t - - /* Title infos FIXME multi-input (not easy) ? */ - int i_title; -- const input_title_t **title; -+ input_title_t * const *title; - - int i_title_offset; - int i_seekpoint_offset; --- -GitLab - - -From adcf4e66e2ce2c382bb97957c91bfde040f4f3ca Mon Sep 17 00:00:00 2001 -From: Zhao Zhili <quinkblack@foxmail.com> -Date: Thu, 1 Mar 2018 14:25:59 +0800 -Subject: [PATCH 2/5] yadif: fix variable type - -Signed-off-by: Thomas Guillem <thomas@gllm.fr> -(cherry picked from commit 77b86f4452be4dbe0d56a9cd1b66da61b116da60) -Signed-off-by: Thomas Guillem <thomas@gllm.fr> ---- - modules/video_filter/deinterlace/yadif.h | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/modules/video_filter/deinterlace/yadif.h b/modules/video_filter/deinterlace/yadif.h -index 4bc592ba9307..af16443d0804 100644 ---- a/modules/video_filter/deinterlace/yadif.h -+++ b/modules/video_filter/deinterlace/yadif.h -@@ -140,10 +140,10 @@ static void yadif_filter_line_c(uint8_t *dst, uint8_t *prev, uint8_t *cur, uint8 - } - - static void yadif_filter_line_c_16bit(uint8_t *dst8, uint8_t *prev8, uint8_t *cur8, uint8_t *next8, int w, int prefs, int mrefs, int parity, int mode) { -- uint8_t *dst = (uint8_t *)dst8; -- uint8_t *prev = (uint8_t *)prev8; -- uint8_t *cur = (uint8_t *)cur8; -- uint8_t *next = (uint8_t *)next8; -+ uint16_t *dst = (uint16_t *)dst8; -+ uint16_t *prev = (uint16_t *)prev8; -+ uint16_t *cur = (uint16_t *)cur8; -+ uint16_t *next = (uint16_t *)next8; - int x; - uint16_t *prev2= parity ? prev : cur ; - uint16_t *next2= parity ? cur : next; --- -GitLab - - -From 45198e5328ff2b2f4eb2fb76add0789fec26270f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= <remi@remlab.net> -Date: Sun, 3 Mar 2019 09:59:10 +0200 -Subject: [PATCH 3/5] swscale: avoid invalid pointer conversion - -(cherry picked from commit ab00e6c59d42e05ab08893091783d8b5febc0058) -Signed-off-by: Thomas Guillem <thomas@gllm.fr> ---- - modules/video_chroma/swscale.c | 12 ++++++++---- - 1 file changed, 8 insertions(+), 4 deletions(-) - -diff --git a/modules/video_chroma/swscale.c b/modules/video_chroma/swscale.c -index 8993d11ec5dd..11897527355c 100644 ---- a/modules/video_chroma/swscale.c -+++ b/modules/video_chroma/swscale.c -@@ -588,8 +588,9 @@ static void Convert( filter_t *p_filter, struct SwsContext *ctx, - { - filter_sys_t *p_sys = p_filter->p_sys; - uint8_t palette[AVPALETTE_SIZE]; -- uint8_t *src[4]; int src_stride[4]; -- uint8_t *dst[4]; int dst_stride[4]; -+ uint8_t *src[4], *dst[4]; -+ const uint8_t *csrc[4]; -+ int src_stride[4], dst_stride[4]; - - GetPixels( src, src_stride, p_sys->desc_in, &p_filter->fmt_in.video, - p_src, i_plane_count, b_swap_uvi ); -@@ -606,11 +607,14 @@ static void Convert( filter_t *p_filter, struct SwsContext *ctx, - GetPixels( dst, dst_stride, p_sys->desc_out, &p_filter->fmt_out.video, - p_dst, i_plane_count, b_swap_uvo ); - -+ for (size_t i = 0; i < ARRAY_SIZE(src); i++) -+ csrc[i] = src[i]; -+ - #if LIBSWSCALE_VERSION_INT >= ((0<<16)+(5<<8)+0) -- sws_scale( ctx, src, src_stride, 0, i_height, -+ sws_scale( ctx, csrc, src_stride, 0, i_height, - dst, dst_stride ); - #else -- sws_scale_ordered( ctx, src, src_stride, 0, i_height, -+ sws_scale_ordered( ctx, csrc, src_stride, 0, i_height, - dst, dst_stride ); - #endif - } --- -GitLab - - -From 4431076ad4a21fdcabd3f7ef1d61c45891689b0c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= <remi@remlab.net> -Date: Sun, 3 Mar 2019 17:20:04 +0200 -Subject: [PATCH 4/5] dynamicoverlay: fix variable shadowing - -(cherry picked from commit d42e05d6b2c061ae352c131d5aebf8c8d8aa6d35) -Signed-off-by: Thomas Guillem <thomas@gllm.fr> ---- - modules/spu/dynamicoverlay/dynamicoverlay_commands.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/modules/spu/dynamicoverlay/dynamicoverlay_commands.c b/modules/spu/dynamicoverlay/dynamicoverlay_commands.c -index a93462925e8a..a85f9aafb0b9 100644 ---- a/modules/spu/dynamicoverlay/dynamicoverlay_commands.c -+++ b/modules/spu/dynamicoverlay/dynamicoverlay_commands.c -@@ -899,12 +899,11 @@ static const commanddesc_static_t p_commands[] = - void RegisterCommand( filter_t *p_filter ) - { - filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys; -- size_t i_index = 0; - - p_sys->i_commands = ARRAY_SIZE(p_commands); - p_sys->pp_commands = (commanddesc_t **) calloc( p_sys->i_commands, sizeof(commanddesc_t*) ); - if( !p_sys->pp_commands ) return; -- for( i_index = 0; i_index < p_sys->i_commands; i_index ++ ) -+ for( size_t i_index = 0; i_index < p_sys->i_commands; i_index ++ ) - { - p_sys->pp_commands[i_index] = (commanddesc_t *) malloc( sizeof(commanddesc_t) ); - if( !p_sys->pp_commands[i_index] ) return; --- -GitLab - - -From fda14fc7c013eb75291df10cc8b88336c51328ad Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= <remi@remlab.net> -Date: Mon, 26 Feb 2018 20:43:03 +0200 -Subject: [PATCH 5/5] dynamicoverlay: fix memory corruption - -Font alpha is 8-bits, not 32-bits. - -(cherry picked from commit 6f14081af7325d334a53126c4eea52bc30fc08a0) -Signed-off-by: Thomas Guillem <thomas@gllm.fr> ---- - modules/spu/dynamicoverlay/dynamicoverlay_commands.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/modules/spu/dynamicoverlay/dynamicoverlay_commands.c b/modules/spu/dynamicoverlay/dynamicoverlay_commands.c -index a85f9aafb0b9..7a71c6f2373a 100644 ---- a/modules/spu/dynamicoverlay/dynamicoverlay_commands.c -+++ b/modules/spu/dynamicoverlay/dynamicoverlay_commands.c -@@ -234,8 +234,12 @@ static int parser_SetTextAlpha( char *psz_command, char *psz_end, - skip_space( &psz_command ); - if( isdigit( (unsigned char)*psz_command ) ) - { -- if( parse_digit( &psz_command, &p_params->fontstyle.i_font_alpha ) == VLC_EGENERIC ) -+ int32_t value; -+ -+ if( parse_digit( &psz_command, &value ) == VLC_EGENERIC ) - return VLC_EGENERIC; -+ -+ p_params->fontstyle.i_font_alpha = value; - } - return VLC_SUCCESS; - } --- -GitLab - |