Update 3.x snapshot

remotes/1735194482819717814/el9
Leigh Scott 3 years ago
parent 410c5350d9
commit 9de2aaa93b

@ -1,444 +0,0 @@
From e51408a0549371efae3792aa40f5c2d992d8b4d4 Mon Sep 17 00:00:00 2001
From: Ilkka Ollakka <ileoo@videolan.org>
Date: Wed, 7 Jul 2021 12:37:58 +0000
Subject: [PATCH 1/4] avcodec: remove use of av_init_packet as it is deprecated
in new ffmpeg major version
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
av_init_packet is deprecated in new major version of ffmpeg.
Also use av_packet_free instead of unref.
Use av_packet_clone and AVPacket * in vlc_av_packet_t.
(cherry picked from commit 16fd46fa506424134beb53ec88be3eea1b42a221)
Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
---
modules/codec/avcodec/audio.c | 12 +++++++-----
modules/codec/avcodec/encoder.c | 25 ++++++++++++++-----------
modules/codec/avcodec/subtitle.c | 17 +++++++++++------
modules/codec/avcodec/video.c | 30 +++++++++++++++++-------------
modules/demux/avformat/mux.c | 29 +++++++++++++++++------------
5 files changed, 66 insertions(+), 47 deletions(-)
diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c
index eec255ae0b..8c3fa7a217 100644
--- a/modules/codec/avcodec/audio.c
+++ b/modules/codec/avcodec/audio.c
@@ -363,11 +363,13 @@ static int DecodeBlock( decoder_t *p_dec, block_t **pp_block )
/* Feed in the loop as buffer could have been full on first iterations */
if( p_block )
{
- AVPacket pkt;
- av_init_packet( &pkt );
- pkt.data = p_block->p_buffer;
- pkt.size = p_block->i_buffer;
- ret = avcodec_send_packet( ctx, &pkt );
+ AVPacket *pkt = av_packet_alloc();
+ if( !pkt )
+ goto end;
+ pkt->data = p_block->p_buffer;
+ pkt->size = p_block->i_buffer;
+ ret = avcodec_send_packet( ctx, pkt );
+ av_packet_free(&pkt);
if( ret == 0 ) /* Block has been consumed */
{
/* Only set new pts from input block if it has been used,
diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index b083d171f3..27af11a412 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -1061,14 +1061,14 @@ error:
typedef struct
{
block_t self;
- AVPacket packet;
+ AVPacket *packet;
} vlc_av_packet_t;
static void vlc_av_packet_Release(block_t *block)
{
vlc_av_packet_t *b = (void *) block;
- av_packet_unref(&b->packet);
+ av_packet_free( &b->packet );
free(b);
}
@@ -1089,7 +1089,7 @@ static block_t *vlc_av_packet_Wrap(AVPacket *packet, mtime_t i_length, AVCodecCo
block_Init( p_block, packet->data, packet->size );
p_block->i_nb_samples = 0;
p_block->pf_release = vlc_av_packet_Release;
- b->packet = *packet;
+ b->packet = packet;
p_block->i_length = i_length;
p_block->i_pts = packet->pts;
@@ -1138,11 +1138,13 @@ static void check_hurry_up( encoder_sys_t *p_sys, AVFrame *frame, encoder_t *p_e
static block_t *encode_avframe( encoder_t *p_enc, encoder_sys_t *p_sys, AVFrame *frame )
{
- AVPacket av_pkt;
- av_pkt.data = NULL;
- av_pkt.size = 0;
+ AVPacket *av_pkt = av_packet_alloc();
- av_init_packet( &av_pkt );
+ if( !av_pkt )
+ {
+ av_frame_unref( frame );
+ return NULL;
+ }
int ret = avcodec_send_frame( p_sys->p_context, frame );
if( frame && ret != 0 && ret != AVERROR(EAGAIN) )
@@ -1150,18 +1152,19 @@ static block_t *encode_avframe( encoder_t *p_enc, encoder_sys_t *p_sys, AVFrame
msg_Warn( p_enc, "cannot send one frame to encoder %d", ret );
return NULL;
}
- ret = avcodec_receive_packet( p_sys->p_context, &av_pkt );
+ ret = avcodec_receive_packet( p_sys->p_context, av_pkt );
if( ret != 0 && ret != AVERROR(EAGAIN) )
{
msg_Warn( p_enc, "cannot encode one frame" );
+ av_packet_free( &av_pkt );
return NULL;
}
- block_t *p_block = vlc_av_packet_Wrap( &av_pkt,
- av_pkt.duration / p_sys->p_context->time_base.den, p_sys->p_context );
+ block_t *p_block = vlc_av_packet_Wrap( av_pkt,
+ av_pkt->duration / p_sys->p_context->time_base.den, p_sys->p_context );
if( unlikely(p_block == NULL) )
{
- av_packet_unref( &av_pkt );
+ av_packet_free( &av_pkt );
return NULL;
}
return p_block;
diff --git a/modules/codec/avcodec/subtitle.c b/modules/codec/avcodec/subtitle.c
index 5cac6339d6..a17ba985e1 100644
--- a/modules/codec/avcodec/subtitle.c
+++ b/modules/codec/avcodec/subtitle.c
@@ -186,16 +186,21 @@ static subpicture_t *DecodeBlock(decoder_t *dec, block_t **block_ptr)
AVSubtitle subtitle;
memset(&subtitle, 0, sizeof(subtitle));
- AVPacket pkt;
- av_init_packet(&pkt);
- pkt.data = block->p_buffer;
- pkt.size = block->i_buffer;
- pkt.pts = block->i_pts;
+ AVPacket *pkt = av_packet_alloc();
+ if(!pkt)
+ {
+ block_Release(block);
+ return NULL;
+ }
+ pkt->data = block->p_buffer;
+ pkt->size = block->i_buffer;
+ pkt->pts = block->i_pts;
int has_subtitle = 0;
int used = avcodec_decode_subtitle2(sys->p_context,
- &subtitle, &has_subtitle, &pkt);
+ &subtitle, &has_subtitle, pkt);
+ av_packet_free(&pkt);
if (used < 0) {
msg_Warn(dec, "cannot decode one subtitle (%zu bytes)",
block->i_buffer);
diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index b99eb56e4a..2b1e3ad314 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -1015,14 +1015,18 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block, bool *error
if( b_has_data || b_start_drain )
{
- AVPacket pkt;
- av_init_packet( &pkt );
+ AVPacket *pkt = av_packet_alloc();
+ if(!pkt)
+ {
+ *error = true;
+ break;
+ }
if( b_has_data )
{
- pkt.data = p_block->p_buffer;
- pkt.size = p_block->i_buffer;
- pkt.pts = p_block->i_pts > VLC_TS_INVALID ? p_block->i_pts : AV_NOPTS_VALUE;
- pkt.dts = p_block->i_dts > VLC_TS_INVALID ? p_block->i_dts : AV_NOPTS_VALUE;
+ pkt->data = p_block->p_buffer;
+ pkt->size = p_block->i_buffer;
+ pkt->pts = p_block->i_pts > VLC_TS_INVALID ? p_block->i_pts : AV_NOPTS_VALUE;
+ pkt->dts = p_block->i_dts > VLC_TS_INVALID ? p_block->i_dts : AV_NOPTS_VALUE;
/* Make sure we don't reuse the same timestamps twice */
p_block->i_pts =
@@ -1031,21 +1035,21 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block, bool *error
else /* start drain */
{
/* Return delayed frames if codec has CODEC_CAP_DELAY */
- pkt.data = NULL;
- pkt.size = 0;
+ pkt->data = NULL;
+ pkt->size = 0;
p_sys->b_draining = true;
}
if( !p_sys->palette_sent )
{
- uint8_t *pal = av_packet_new_side_data(&pkt, AV_PKT_DATA_PALETTE, AVPALETTE_SIZE);
+ uint8_t *pal = av_packet_new_side_data(pkt, AV_PKT_DATA_PALETTE, AVPALETTE_SIZE);
if (pal) {
memcpy(pal, p_dec->fmt_in.video.p_palette->palette, AVPALETTE_SIZE);
p_sys->palette_sent = true;
}
}
- ret = avcodec_send_packet(p_context, &pkt);
+ ret = avcodec_send_packet(p_context, pkt);
if( ret != 0 && ret != AVERROR(EAGAIN) )
{
if (ret == AVERROR(ENOMEM) || ret == AVERROR(EINVAL))
@@ -1053,11 +1057,11 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block, bool *error
msg_Err(p_dec, "avcodec_send_packet critical error");
*error = true;
}
- av_packet_unref( &pkt );
+ av_packet_free( &pkt );
break;
}
- i_used = ret != AVERROR(EAGAIN) ? pkt.size : 0;
- av_packet_unref( &pkt );
+ i_used = ret != AVERROR(EAGAIN) ? pkt->size : 0;
+ av_packet_free( &pkt );
}
AVFrame *frame = av_frame_alloc();
diff --git a/modules/demux/avformat/mux.c b/modules/demux/avformat/mux.c
index 48878c712b..405a6f6933 100644
--- a/modules/demux/avformat/mux.c
+++ b/modules/demux/avformat/mux.c
@@ -341,14 +341,16 @@ static int MuxBlock( sout_mux_t *p_mux, sout_input_t *p_input )
block_t *p_data = block_FifoGet( p_input->p_fifo );
int i_stream = *((int *)p_input->p_sys);
AVStream *p_stream = p_sys->oc->streams[i_stream];
- AVPacket pkt;
-
- memset( &pkt, 0, sizeof(AVPacket) );
+ AVPacket *pkt = av_packet_alloc();
+ if( !pkt )
+ {
+ block_Release( p_data );
+ return VLC_EGENERIC;
+ }
- av_init_packet(&pkt);
- pkt.data = p_data->p_buffer;
- pkt.size = p_data->i_buffer;
- pkt.stream_index = i_stream;
+ pkt->data = p_data->p_buffer;
+ pkt->size = p_data->i_buffer;
+ pkt->stream_index = i_stream;
if( p_data->i_flags & BLOCK_FLAG_TYPE_I )
{
@@ -359,29 +361,32 @@ static int MuxBlock( sout_mux_t *p_mux, sout_input_t *p_input )
#endif
p_sys->b_write_keyframe = true;
- pkt.flags |= AV_PKT_FLAG_KEY;
+ pkt->flags |= AV_PKT_FLAG_KEY;
}
if( p_data->i_pts > 0 )
- pkt.pts = p_data->i_pts * p_stream->time_base.den /
+ pkt->pts = p_data->i_pts * p_stream->time_base.den /
CLOCK_FREQ / p_stream->time_base.num;
if( p_data->i_dts > 0 )
- pkt.dts = p_data->i_dts * p_stream->time_base.den /
+ pkt->dts = p_data->i_dts * p_stream->time_base.den /
CLOCK_FREQ / p_stream->time_base.num;
/* this is another hack to prevent libavformat from triggering the "non monotone timestamps" check in avformat/utils.c */
p_stream->cur_dts = ( p_data->i_dts * p_stream->time_base.den /
CLOCK_FREQ / p_stream->time_base.num ) - 1;
- if( av_write_frame( p_sys->oc, &pkt ) < 0 )
+ if( av_write_frame( p_sys->oc, pkt ) < 0 )
{
msg_Err( p_mux, "could not write frame (pts: %"PRId64", dts: %"PRId64") "
"(pkt pts: %"PRId64", dts: %"PRId64")",
- p_data->i_pts, p_data->i_dts, pkt.pts, pkt.dts );
+ p_data->i_pts, p_data->i_dts, pkt->pts, pkt->dts );
block_Release( p_data );
+ av_packet_unref( pkt );
return VLC_EGENERIC;
}
+
+ av_packet_unref( pkt );
block_Release( p_data );
return VLC_SUCCESS;
}
--
GitLab
From c70bb79bb84a59d2bb37ddffb4c3098f76c3f71b Mon Sep 17 00:00:00 2001
From: Ilkka Ollakka <ileoo@videolan.org>
Date: Fri, 18 Jun 2021 10:23:35 +0300
Subject: [PATCH 2/4] avcodec/subtitle: stop using removed setter for pkt
timebase
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Removed from ffmpeg repo in commit 23bb78d2ea4f0e3a0835744d59708efed50abccc.
(cherry picked from commit e7190e7a70e9701754c50348f5b6357759440657)
Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
---
modules/codec/avcodec/subtitle.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/modules/codec/avcodec/subtitle.c b/modules/codec/avcodec/subtitle.c
index a17ba985e1..d3afe4270b 100644
--- a/modules/codec/avcodec/subtitle.c
+++ b/modules/codec/avcodec/subtitle.c
@@ -90,7 +90,9 @@ int InitSubtitleDec(vlc_object_t *obj)
context->extradata_size = 0;
context->extradata = NULL;
-#if LIBAVFORMAT_VERSION_MICRO >= 100
+#if LIBAVFORMAT_VERSION_MAJOR >= 59
+ context->pkt_timebase=AV_TIME_BASE_Q;
+#elif LIBAVFORMAT_VERSION_MICRO >= 100
av_codec_set_pkt_timebase(context, AV_TIME_BASE_Q);
#endif
--
GitLab
From ab36b209ff07d5465a4958201521a9c2345fd918 Mon Sep 17 00:00:00 2001
From: Alexandre Janniaux <ajanni@videolabs.io>
Date: Wed, 8 Apr 2020 15:07:15 +0200
Subject: [PATCH 3/4] avcodec: remove deprecation warning for av*_register_all
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From doc/APIchanges:
2018-02-06 - 0694d87024 - lavf 58.9.100 - avformat.h
Deprecate use of av_register_input_format(), av_register_output_format(),
av_register_all(), av_iformat_next(), av_oformat_next().
Add av_demuxer_iterate(), and av_muxer_iterate().
2018-02-06 - 36c85d6e77 - lavc 58.10.100 - avcodec.h
Deprecate use of avcodec_register(), avcodec_register_all(),
av_codec_next(), av_register_codec_parser(), and av_parser_next().
Add av_codec_iterate() and av_parser_iterate().
They are no-op since those updates. If compiling with a recent release,
just don't call av*_register_all to prevent warnings.
(cherry picked from commit 21d5a1933275edb7f67d05ea62a762464e07c2cb)
Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
---
modules/codec/avcodec/avcommon.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/modules/codec/avcodec/avcommon.h b/modules/codec/avcodec/avcommon.h
index 8c8298014f..158c01e320 100644
--- a/modules/codec/avcodec/avcommon.h
+++ b/modules/codec/avcodec/avcommon.h
@@ -97,6 +97,7 @@ static inline void vlc_init_avutil(vlc_object_t *obj)
#ifdef HAVE_LIBAVFORMAT_AVFORMAT_H
# include <libavformat/avformat.h>
+# include <libavformat/version.h>
static inline void vlc_init_avformat(vlc_object_t *obj)
{
vlc_avcodec_lock();
@@ -105,7 +106,9 @@ static inline void vlc_init_avformat(vlc_object_t *obj)
avformat_network_init();
+#if (LIBAVFORMAT_VERSION_MICRO >= 100) && (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 9, 100))
av_register_all();
+#endif
vlc_avcodec_unlock();
}
@@ -113,13 +116,16 @@ static inline void vlc_init_avformat(vlc_object_t *obj)
#ifdef HAVE_LIBAVCODEC_AVCODEC_H
# include <libavcodec/avcodec.h>
+# include <libavcodec/version.h>
static inline void vlc_init_avcodec(vlc_object_t *obj)
{
vlc_avcodec_lock();
vlc_init_avutil(obj);
+#if (LIBAVFORMAT_VERSION_MICRO >= 100) && (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 10, 100))
avcodec_register_all();
+#endif
vlc_avcodec_unlock();
}
--
GitLab
From 8a0afbf54ba5b694deb5dcba7a63959fb222f93a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= <remi@remlab.net>
Date: Tue, 14 Apr 2020 19:25:07 +0300
Subject: [PATCH 4/4] avcodec: fix flawed logic
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cannot find any codec.
Regression from 21d5a1933275edb7f67d05ea62a762464e07c2cb.
(cherry picked from commit 067dcd0a1974b00a92e900b0e5c976349ad13859)
Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
---
modules/codec/avcodec/avcommon.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/codec/avcodec/avcommon.h b/modules/codec/avcodec/avcommon.h
index 158c01e320..ff5dba06c9 100644
--- a/modules/codec/avcodec/avcommon.h
+++ b/modules/codec/avcodec/avcommon.h
@@ -106,7 +106,7 @@ static inline void vlc_init_avformat(vlc_object_t *obj)
avformat_network_init();
-#if (LIBAVFORMAT_VERSION_MICRO >= 100) && (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 9, 100))
+#if (LIBAVFORMAT_VERSION_MICRO < 100) || (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 9, 100))
av_register_all();
#endif
@@ -123,7 +123,7 @@ static inline void vlc_init_avcodec(vlc_object_t *obj)
vlc_init_avutil(obj);
-#if (LIBAVFORMAT_VERSION_MICRO >= 100) && (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 10, 100))
+#if (LIBAVFORMAT_VERSION_MICRO < 100) || (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 10, 100))
avcodec_register_all();
#endif
--
GitLab

@ -1 +1 @@
SHA512 (vlc-a108715.tar.gz) = 1c07ded8648642fb8839de59d3b410d7e7182b3f53a38bbd2db4a1b601bf5ca0d686ca3e1384ec7572f387a1801336ec268c118b50e652d8d8f56beae9c5edda
SHA512 (vlc-584bf4f.tar.gz) = 1a71b37821c63efe120d71aa54ec5630320c03457b7bdd23bbef7c3cb430fd4a4234c18abad888d65a57e7b099cd130519eaa28de90400b1beaa861249b135d2

@ -1,4 +1,4 @@
%global commit0 a108715f1d0f6e7c878a5b9ba01c799f08dc78f3
%global commit0 584bf4f6414daf73adba01fd10f7b0aafdc1330d
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
#global vlc_rc -rc9
@ -51,7 +51,7 @@ Summary: The cross-platform open-source multimedia framework, player and server
Epoch: 1
Name: vlc
Version: 3.0.17
Release: 2%{?dist}
Release: 3%{?dist}
License: GPLv2+
URL: https://www.videolan.org
%if 0%{?commit0:1}
@ -77,8 +77,6 @@ Patch10: recent_srt_fix.patch
Patch11: 0001-Revert-configure-ignore-too-new-SRT.patch
Patch12: 0001-Revert-access-libdvdread-6.1.2-supports-UTF-8-paths-.patch
Patch13: https://code.videolan.org/videolan/vlc/-/merge_requests/895.patch#/ffmpeg45.patch
BuildRequires: desktop-file-utils
BuildRequires: libappstream-glib
BuildRequires: fontpackages-devel
@ -356,9 +354,6 @@ sed -i -e 's/luac/luac-5.1/g' configure.ac
%if 0%{?rhel} >= 7
%patch12 -p1
%endif
%if 0%{?fedora} > 35
%patch13 -p1
%endif
%{?_with_bootstrap:
rm aclocal.m4 m4/lib*.m4 m4/lt*.m4 || :
@ -623,6 +618,9 @@ fi || :
%changelog
* Sat Jan 15 2022 Leigh Scott <leigh123linux@gmail.com> - 1:3.0.17-3
- Update 3.x snapshot
* Fri Nov 19 2021 Nicolas Chauvet <kwizart@gmail.com> - 1:3.0.17-2
- Rebuilt

Loading…
Cancel
Save