From b4c36b75b6e16507aa2aea58c1ede45c5ba1f01f Mon Sep 17 00:00:00 2001 From: Leigh Scott Date: Wed, 30 Jun 2021 21:16:12 +0100 Subject: [PATCH 01/24] Rebuilt --- vlc.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vlc.spec b/vlc.spec index 30a63be..b4fefbc 100644 --- a/vlc.spec +++ b/vlc.spec @@ -51,7 +51,7 @@ Summary: The cross-platform open-source multimedia framework, player and server Epoch: 1 Name: vlc Version: 3.0.16 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ URL: https://www.videolan.org %if 0%{?commit0:1} @@ -622,6 +622,9 @@ fi || : %changelog +* Wed Jun 30 2021 Leigh Scott - 1:3.0.16-2 +- Rebuilt + * Sat Jun 19 2021 Leigh Scott - 1:3.0.16-1 - Update to 3.0.16 From 3baadf2c7c867ce7b9ab289041877c41566aa8b0 Mon Sep 17 00:00:00 2001 From: Leigh Scott Date: Wed, 30 Jun 2021 21:33:04 +0100 Subject: [PATCH 02/24] Make check non-fatal --- vlc.spec | 4 ---- 1 file changed, 4 deletions(-) diff --git a/vlc.spec b/vlc.spec index b4fefbc..91aae00 100644 --- a/vlc.spec +++ b/vlc.spec @@ -468,11 +468,7 @@ rm -rf %{buildroot}%{_datadir}/kde4 %if 0%{?el7} . /opt/rh/devtoolset-%{dts_ver}/enable %endif -%ifnarch %{arm} %{arm64} -make check -%else make check || : -%endif %ldconfig_scriptlets core From 4c7bbeba46657171d4e821a761201bd05a86ee97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20M=2E=20Basto?= Date: Sun, 11 Jul 2021 02:55:32 +0100 Subject: [PATCH 03/24] Mass rebuild for x264-0.163 --- vlc.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vlc.spec b/vlc.spec index 91aae00..86d470b 100644 --- a/vlc.spec +++ b/vlc.spec @@ -51,7 +51,7 @@ Summary: The cross-platform open-source multimedia framework, player and server Epoch: 1 Name: vlc Version: 3.0.16 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ URL: https://www.videolan.org %if 0%{?commit0:1} @@ -618,6 +618,9 @@ fi || : %changelog +* Sun Jul 11 2021 Sérgio Basto - 1:3.0.16-3 +- Mass rebuild for x264-0.163 + * Wed Jun 30 2021 Leigh Scott - 1:3.0.16-2 - Rebuilt From b9e3759a147f86414a0fb23f8ea97a73f53326ca Mon Sep 17 00:00:00 2001 From: Leigh Scott Date: Tue, 3 Aug 2021 19:47:42 +0100 Subject: [PATCH 04/24] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Leigh Scott --- vlc.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vlc.spec b/vlc.spec index 86d470b..6910fb8 100644 --- a/vlc.spec +++ b/vlc.spec @@ -51,7 +51,7 @@ Summary: The cross-platform open-source multimedia framework, player and server Epoch: 1 Name: vlc Version: 3.0.16 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ URL: https://www.videolan.org %if 0%{?commit0:1} @@ -618,6 +618,9 @@ fi || : %changelog +* Tue Aug 03 2021 RPM Fusion Release Engineering - 1:3.0.16-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Sun Jul 11 2021 Sérgio Basto - 1:3.0.16-3 - Mass rebuild for x264-0.163 From 8e9d909395fb2e3103192c92beda00116b2839d1 Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Thu, 19 Aug 2021 16:38:58 +0200 Subject: [PATCH 05/24] Rebuilt --- vlc.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vlc.spec b/vlc.spec index 6910fb8..32421f3 100644 --- a/vlc.spec +++ b/vlc.spec @@ -51,7 +51,7 @@ Summary: The cross-platform open-source multimedia framework, player and server Epoch: 1 Name: vlc Version: 3.0.16 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv2+ URL: https://www.videolan.org %if 0%{?commit0:1} @@ -618,6 +618,9 @@ fi || : %changelog +* Thu Aug 19 2021 Nicolas Chauvet - 1:3.0.16-5 +- Rebuilt + * Tue Aug 03 2021 RPM Fusion Release Engineering - 1:3.0.16-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From e953da7dad21fa420f8cd2f78b6cd17431016003 Mon Sep 17 00:00:00 2001 From: Leigh Scott Date: Sat, 30 Oct 2021 21:29:45 +0100 Subject: [PATCH 06/24] Rebuild --- vlc.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vlc.spec b/vlc.spec index 32421f3..46fbea1 100644 --- a/vlc.spec +++ b/vlc.spec @@ -51,7 +51,7 @@ Summary: The cross-platform open-source multimedia framework, player and server Epoch: 1 Name: vlc Version: 3.0.16 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv2+ URL: https://www.videolan.org %if 0%{?commit0:1} @@ -618,6 +618,9 @@ fi || : %changelog +* Sat Oct 30 2021 Leigh Scott - 1:3.0.16-6 +- rebuilt + * Thu Aug 19 2021 Nicolas Chauvet - 1:3.0.16-5 - Rebuilt From 4cfe09e38260ec02ba675adce2a052f104f72abf Mon Sep 17 00:00:00 2001 From: Leigh Scott Date: Tue, 9 Nov 2021 11:51:14 +0000 Subject: [PATCH 07/24] Rebuilt for new ffmpeg snapshot --- vlc.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vlc.spec b/vlc.spec index 46fbea1..b804318 100644 --- a/vlc.spec +++ b/vlc.spec @@ -51,7 +51,7 @@ Summary: The cross-platform open-source multimedia framework, player and server Epoch: 1 Name: vlc Version: 3.0.16 -Release: 6%{?dist} +Release: 7%{?dist} License: GPLv2+ URL: https://www.videolan.org %if 0%{?commit0:1} @@ -618,6 +618,9 @@ fi || : %changelog +* Tue Nov 09 2021 Leigh Scott - 1:3.0.16-7 +- Rebuilt for new ffmpeg snapshot + * Sat Oct 30 2021 Leigh Scott - 1:3.0.16-6 - rebuilt From 3e020fd312946ee112f5c326c02c4d71ea6d1c43 Mon Sep 17 00:00:00 2001 From: Leigh Scott Date: Tue, 9 Nov 2021 12:22:21 +0000 Subject: [PATCH 08/24] fix --- ffmpeg45.patch | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++ vlc.spec | 3 +++ 2 files changed, 68 insertions(+) create mode 100644 ffmpeg45.patch diff --git a/ffmpeg45.patch b/ffmpeg45.patch new file mode 100644 index 0000000..8d76211 --- /dev/null +++ b/ffmpeg45.patch @@ -0,0 +1,65 @@ +From 21d5a1933275edb7f67d05ea62a762464e07c2cb Mon Sep 17 00:00:00 2001 +From: Alexandre Janniaux +Date: Wed, 8 Apr 2020 15:07:15 +0200 +Subject: [PATCH] avcodec: remove deprecation warning for av*_register_all + +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. +--- + 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 671cde5c81..fa06616433 100644 +--- a/modules/codec/avcodec/avcommon.h ++++ b/modules/codec/avcodec/avcommon.h +@@ -109,6 +109,7 @@ static inline void vlc_init_avutil(vlc_object_t *obj) + + #ifdef HAVE_LIBAVFORMAT_AVFORMAT_H + # include ++# include + static inline void vlc_init_avformat(vlc_object_t *obj) + { + vlc_avcodec_lock(); +@@ -117,7 +118,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(); + } +@@ -125,13 +128,16 @@ static inline void vlc_init_avformat(vlc_object_t *obj) + + #ifdef HAVE_LIBAVCODEC_AVCODEC_H + # include ++# include + 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 + diff --git a/vlc.spec b/vlc.spec index b804318..10a7cfc 100644 --- a/vlc.spec +++ b/vlc.spec @@ -77,6 +77,8 @@ 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: ffmpeg45.patch + BuildRequires: desktop-file-utils BuildRequires: libappstream-glib BuildRequires: fontpackages-devel @@ -354,6 +356,7 @@ sed -i -e 's/luac/luac-5.1/g' configure.ac %if 0%{?rhel} >= 7 %patch12 -p1 %endif +%patch13 -p1 %{?_with_bootstrap: rm aclocal.m4 m4/lib*.m4 m4/lt*.m4 || : From d4bf359633c49fb567de1156e11bc283b9713c2f Mon Sep 17 00:00:00 2001 From: Leigh Scott Date: Mon, 15 Nov 2021 11:12:14 +0000 Subject: [PATCH 09/24] Apply upstream ffmpeg fix to f36+ --- ffmpeg45.patch | 354 ++++++++++++++++++++++++++++++++++++++++++------- vlc.spec | 4 +- 2 files changed, 311 insertions(+), 47 deletions(-) diff --git a/ffmpeg45.patch b/ffmpeg45.patch index 8d76211..df4c3c8 100644 --- a/ffmpeg45.patch +++ b/ffmpeg45.patch @@ -1,65 +1,327 @@ -From 21d5a1933275edb7f67d05ea62a762464e07c2cb Mon Sep 17 00:00:00 2001 -From: Alexandre Janniaux -Date: Wed, 8 Apr 2020 15:07:15 +0200 -Subject: [PATCH] avcodec: remove deprecation warning for av*_register_all +From cde283fef6dc1f70fd46fe891642f3e07edbc433 Mon Sep 17 00:00:00 2001 +From: Ilkka Ollakka +Date: Wed, 7 Jul 2021 12:37:58 +0000 +Subject: [PATCH 1/2] 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 -From doc/APIchanges: +av_init_packet is deprecated in new major version of ffmpeg. - 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(). +Also use av_packet_free instead of unref. - 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(). +Use av_packet_clone and AVPacket * in vlc_av_packet_t. -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 16fd46fa506424134beb53ec88be3eea1b42a221) +Signed-off-by: Hugo Beauzée-Luyssen --- - modules/codec/avcodec/avcommon.h | 6 ++++++ - 1 file changed, 6 insertions(+) + 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/avcommon.h b/modules/codec/avcodec/avcommon.h -index 671cde5c81..fa06616433 100644 ---- a/modules/codec/avcodec/avcommon.h -+++ b/modules/codec/avcodec/avcommon.h -@@ -109,6 +109,7 @@ static inline void vlc_init_avutil(vlc_object_t *obj) - - #ifdef HAVE_LIBAVFORMAT_AVFORMAT_H - # include -+# include - static inline void vlc_init_avformat(vlc_object_t *obj) +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 { - vlc_avcodec_lock(); -@@ -117,7 +118,9 @@ static inline void vlc_init_avformat(vlc_object_t *obj) + block_t self; +- AVPacket packet; ++ AVPacket *packet; + } vlc_av_packet_t; - avformat_network_init(); - -+#if (LIBAVFORMAT_VERSION_MICRO < 100) || (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 9, 100)) - av_register_all(); -+#endif + static void vlc_av_packet_Release(block_t *block) + { + vlc_av_packet_t *b = (void *) block; - vlc_avcodec_unlock(); +- av_packet_unref(&b->packet); ++ av_packet_free( &b->packet ); + free(b); } -@@ -125,13 +128,16 @@ static inline void vlc_init_avformat(vlc_object_t *obj) - #ifdef HAVE_LIBAVCODEC_AVCODEC_H - # include -+# include - static inline void vlc_init_avcodec(vlc_object_t *obj) +@@ -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 ) { - vlc_avcodec_lock(); +- 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..e175cef3a6 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_unref( 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; ++ } - vlc_init_avutil(obj); +- 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 (LIBAVFORMAT_VERSION_MICRO < 100) || (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 10, 100)) - avcodec_register_all(); -+#endif + 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 - vlc_avcodec_unlock(); + 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 149141346ddb419aa7c34fb59803c1db4035ced7 Mon Sep 17 00:00:00 2001 +From: Ilkka Ollakka +Date: Fri, 18 Jun 2021 10:23:35 +0300 +Subject: [PATCH 2/2] 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 +--- + 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 + diff --git a/vlc.spec b/vlc.spec index 10a7cfc..dbea93c 100644 --- a/vlc.spec +++ b/vlc.spec @@ -77,7 +77,7 @@ 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: ffmpeg45.patch +Patch13: https://code.videolan.org/videolan/vlc/-/merge_requests/895.patch#/ffmpeg45.patch BuildRequires: desktop-file-utils BuildRequires: libappstream-glib @@ -356,7 +356,9 @@ 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 || : From 3d5a5922200b72d209049b3b82c584db6aadb4ff Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Mon, 15 Nov 2021 14:58:08 +0100 Subject: [PATCH 10/24] Update to snapshot --- vlc.spec | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/vlc.spec b/vlc.spec index dbea93c..ed8b4f5 100644 --- a/vlc.spec +++ b/vlc.spec @@ -1,5 +1,5 @@ -#global commit0 170157402b9c9ee5651838499549328c6715b5fe -#global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) +%global commit0 a108715f1d0f6e7c878a5b9ba01c799f08dc78f3 +%global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) #global vlc_rc -rc9 %global _with_bootstrap 1 @@ -50,13 +50,13 @@ Summary: The cross-platform open-source multimedia framework, player and server Epoch: 1 Name: vlc -Version: 3.0.16 -Release: 7%{?dist} +Version: 3.0.17 +Release: 1%{?dist} License: GPLv2+ URL: https://www.videolan.org %if 0%{?commit0:1} Source0: https://code.videolan.org/videolan/vlc/-/archive/%{commit0}/vlc-%{shortcommit0}.tar.gz -%global vlc_setup vlc-3.0-%{?commit0} +%global vlc_setup vlc-%{?commit0} %else Source0: https://download.videolan.org/pub/videolan/%{?vlc_rc:testing/}vlc/%{version}%{?vlc_rc}/vlc-%{version}%{?vlc_rc}.tar.xz %global vlc_setup vlc-%{version}%{?vlc_rc} @@ -623,6 +623,9 @@ fi || : %changelog +* Thu Nov 11 2021 Nicolas Chauvet - 1:3.0.17-1 +- Update to 3.x snapshot + * Tue Nov 09 2021 Leigh Scott - 1:3.0.16-7 - Rebuilt for new ffmpeg snapshot From 46051cf58e3e0356e73cac237e18ebe71042f83b Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Fri, 19 Nov 2021 11:13:53 +0100 Subject: [PATCH 11/24] Update patch --- ffmpeg45.patch | 133 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 125 insertions(+), 8 deletions(-) diff --git a/ffmpeg45.patch b/ffmpeg45.patch index df4c3c8..a4eaa02 100644 --- a/ffmpeg45.patch +++ b/ffmpeg45.patch @@ -1,7 +1,7 @@ -From cde283fef6dc1f70fd46fe891642f3e07edbc433 Mon Sep 17 00:00:00 2001 +From e51408a0549371efae3792aa40f5c2d992d8b4d4 Mon Sep 17 00:00:00 2001 From: Ilkka Ollakka Date: Wed, 7 Jul 2021 12:37:58 +0000 -Subject: [PATCH 1/2] avcodec: remove use of av_init_packet as it is deprecated +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 @@ -14,7 +14,7 @@ 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 +Signed-off-by: Hugo Beauzée-Luyssen --- modules/codec/avcodec/audio.c | 12 +++++++----- modules/codec/avcodec/encoder.c | 25 ++++++++++++++----------- @@ -151,7 +151,7 @@ index 5cac6339d6..a17ba985e1 100644 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..e175cef3a6 100644 +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 @@ -216,7 +216,7 @@ index b99eb56e4a..e175cef3a6 100644 - i_used = ret != AVERROR(EAGAIN) ? pkt.size : 0; - av_packet_unref( &pkt ); + i_used = ret != AVERROR(EAGAIN) ? pkt->size : 0; -+ av_packet_unref( pkt ); ++ av_packet_free( &pkt ); } AVFrame *frame = av_frame_alloc(); @@ -290,10 +290,10 @@ index 48878c712b..405a6f6933 100644 GitLab -From 149141346ddb419aa7c34fb59803c1db4035ced7 Mon Sep 17 00:00:00 2001 +From c70bb79bb84a59d2bb37ddffb4c3098f76c3f71b Mon Sep 17 00:00:00 2001 From: Ilkka Ollakka Date: Fri, 18 Jun 2021 10:23:35 +0300 -Subject: [PATCH 2/2] avcodec/subtitle: stop using removed setter for pkt +Subject: [PATCH 2/4] avcodec/subtitle: stop using removed setter for pkt timebase MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -302,7 +302,7 @@ Content-Transfer-Encoding: 8bit Removed from ffmpeg repo in commit 23bb78d2ea4f0e3a0835744d59708efed50abccc. (cherry picked from commit e7190e7a70e9701754c50348f5b6357759440657) -Signed-off-by: Hugo Beauzée-Luyssen +Signed-off-by: Hugo Beauzée-Luyssen --- modules/codec/avcodec/subtitle.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) @@ -325,3 +325,120 @@ index a17ba985e1..d3afe4270b 100644 -- GitLab + +From ab36b209ff07d5465a4958201521a9c2345fd918 Mon Sep 17 00:00:00 2001 +From: Alexandre Janniaux +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 +--- + 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 ++# include + 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 ++# include + 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?= +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 +--- + 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 + + From c008e7ebde78aacda651f80b1dfee25d3156f26b Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Fri, 19 Nov 2021 11:14:38 +0100 Subject: [PATCH 12/24] Rebuilt --- vlc.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vlc.spec b/vlc.spec index ed8b4f5..936df74 100644 --- a/vlc.spec +++ b/vlc.spec @@ -51,7 +51,7 @@ Summary: The cross-platform open-source multimedia framework, player and server Epoch: 1 Name: vlc Version: 3.0.17 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ URL: https://www.videolan.org %if 0%{?commit0:1} @@ -623,6 +623,9 @@ fi || : %changelog +* Fri Nov 19 2021 Nicolas Chauvet - 1:3.0.17-2 +- Rebuilt + * Thu Nov 11 2021 Nicolas Chauvet - 1:3.0.17-1 - Update to 3.x snapshot From 410c5350d95c36555413893f6261706c6ddd953e Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Fri, 19 Nov 2021 11:21:34 +0100 Subject: [PATCH 13/24] Add sources --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index ed2ba8a..8370137 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (vlc-3.0.16.tar.xz) = 35cdf191071224d0cf1b5a83c00773ff87b9e5bfcf0f5523f7edd53f75b23eda6b27bb49ffa97d69a1d176b8fe4786d959aeeb00d4380beab71c9f7e6b7c7298 +SHA512 (vlc-a108715.tar.gz) = 1c07ded8648642fb8839de59d3b410d7e7182b3f53a38bbd2db4a1b601bf5ca0d686ca3e1384ec7572f387a1801336ec268c118b50e652d8d8f56beae9c5edda From 9de2aaa93b153a3372ae387a4390df0ef1cb5fbe Mon Sep 17 00:00:00 2001 From: Leigh Scott Date: Sat, 15 Jan 2022 11:43:39 +0000 Subject: [PATCH 14/24] Update 3.x snapshot --- ffmpeg45.patch | 444 ------------------------------------------------- sources | 2 +- vlc.spec | 12 +- 3 files changed, 6 insertions(+), 452 deletions(-) delete mode 100644 ffmpeg45.patch diff --git a/ffmpeg45.patch b/ffmpeg45.patch deleted file mode 100644 index a4eaa02..0000000 --- a/ffmpeg45.patch +++ /dev/null @@ -1,444 +0,0 @@ -From e51408a0549371efae3792aa40f5c2d992d8b4d4 Mon Sep 17 00:00:00 2001 -From: Ilkka Ollakka -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 ---- - 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 -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 ---- - 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 -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 ---- - 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 -+# include - 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 -+# include - 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?= -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 ---- - 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 - - diff --git a/sources b/sources index 8370137..954b6a8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (vlc-a108715.tar.gz) = 1c07ded8648642fb8839de59d3b410d7e7182b3f53a38bbd2db4a1b601bf5ca0d686ca3e1384ec7572f387a1801336ec268c118b50e652d8d8f56beae9c5edda +SHA512 (vlc-584bf4f.tar.gz) = 1a71b37821c63efe120d71aa54ec5630320c03457b7bdd23bbef7c3cb430fd4a4234c18abad888d65a57e7b099cd130519eaa28de90400b1beaa861249b135d2 diff --git a/vlc.spec b/vlc.spec index 936df74..647c06a 100644 --- a/vlc.spec +++ b/vlc.spec @@ -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 - 1:3.0.17-3 +- Update 3.x snapshot + * Fri Nov 19 2021 Nicolas Chauvet - 1:3.0.17-2 - Rebuilt From 5a5f6fbaf04a427a5026f4b4f5312e79136c39a5 Mon Sep 17 00:00:00 2001 From: Leigh Scott Date: Sat, 15 Jan 2022 13:08:17 +0000 Subject: [PATCH 15/24] Fix build with new live555 --- ...f.-from-getConnectionEndpointAddress.patch | 50 +++++++++++++++++++ vlc.spec | 5 ++ 2 files changed, 55 insertions(+) create mode 100644 0001-Get-addr-by-ref.-from-getConnectionEndpointAddress.patch diff --git a/0001-Get-addr-by-ref.-from-getConnectionEndpointAddress.patch b/0001-Get-addr-by-ref.-from-getConnectionEndpointAddress.patch new file mode 100644 index 0000000..a4dca5c --- /dev/null +++ b/0001-Get-addr-by-ref.-from-getConnectionEndpointAddress.patch @@ -0,0 +1,50 @@ +From 94845266b705dc9de7921408531b9d7704f4458f Mon Sep 17 00:00:00 2001 +From: Dominic Mayers +Date: Sun, 28 Mar 2021 04:37:54 -0400 +Subject: [PATCH] Get addr by ref. from getConnectionEndpointAddress. + +Fixes issue #25473 in code.videolan.org. The maintainers of live555 changed +connectionEndpointAddresss to getConnectionEndpointAddress, which now provides +the address value by reference. Before, connectionEndpointAddresss returned +the value. So, in modules/access/live555.cpp, we must first get the value and +then pass it to IsMulticastAddress. The code will not compile with the recent +live555 unless we also modify modules/access/Makefile.am - a different patch. +--- + modules/access/live555.cpp | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/modules/access/live555.cpp b/modules/access/live555.cpp +index 01c535ca5b..95e15e35d9 100644 +--- a/modules/access/live555.cpp ++++ b/modules/access/live555.cpp +@@ -60,6 +60,7 @@ + #include + #include + #include ++#include + + extern "C" { + #include "../access/mms/asf.h" /* Who said ugly ? */ +@@ -727,7 +728,8 @@ static int SessionsSetup( demux_t *p_demux ) + unsigned const thresh = 200000; /* RTP reorder threshold .2 second (default .1) */ + const char *p_sess_lang = NULL; + const char *p_lang; +- ++ struct sockaddr_storage addr; ++ + b_rtsp_tcp = var_CreateGetBool( p_demux, "rtsp-tcp" ) || + var_GetBool( p_demux, "rtsp-http" ); + i_client_port = var_InheritInteger( p_demux, "rtp-client-port" ); +@@ -850,7 +852,8 @@ static int SessionsSetup( demux_t *p_demux ) + if( !p_sys->b_multicast ) + { + /* We need different rollover behaviour for multicast */ +- p_sys->b_multicast = IsMulticastAddress( sub->connectionEndpointAddress() ); ++ sub->getConnectionEndpointAddress(addr); ++ p_sys->b_multicast = IsMulticastAddress( addr ); + } + + tk = (live_track_t*)malloc( sizeof( live_track_t ) ); +-- +2.25.1 + diff --git a/vlc.spec b/vlc.spec index 647c06a..024fd60 100644 --- a/vlc.spec +++ b/vlc.spec @@ -76,6 +76,8 @@ Patch9: notify-don-t-depend-on-any-GTK-version.patch 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 +# https://code.videolan.org/videolan/vlc/-/issues/25473#note_256576 +Patch13: 0001-Get-addr-by-ref.-from-getConnectionEndpointAddress.patch BuildRequires: desktop-file-utils BuildRequires: libappstream-glib @@ -354,6 +356,9 @@ 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 || : From b2e2ca70f6c7d0554ba043a9f1b640ff190ed113 Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Tue, 18 Jan 2022 17:50:45 +0100 Subject: [PATCH 16/24] Add WIP remaining patch for FFmpeg-5.0 --- 1245.patch | 382 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 382 insertions(+) create mode 100644 1245.patch diff --git a/1245.patch b/1245.patch new file mode 100644 index 0000000..d4bb33d --- /dev/null +++ b/1245.patch @@ -0,0 +1,382 @@ +From dbf942baa1169affbb32094cbdeecee488971a13 Mon Sep 17 00:00:00 2001 +From: Romain Vimont +Date: Tue, 18 Jan 2022 15:06:28 +0100 +Subject: [PATCH 1/8] avcodec: use AVFrame.pts + +> Decoders now export the frame timestamp as AVFrame.pts. It was +> previously exported as AVFrame.pkt_pts, which is now deprecated. + +Refs ffmpeg/32c8359093d1ff4f45ed19518b449b3ac3769d27 (deprecation) +Refs ffmpeg/6e30b35b85b81c802e52a1078ec7a3097e353c6d (removal) +--- + modules/codec/avcodec/video.c | 7 ------- + 1 file changed, 7 deletions(-) + +diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c +index 2b1e3ad314..c7da048f86 100644 +--- a/modules/codec/avcodec/video.c ++++ b/modules/codec/avcodec/video.c +@@ -1114,14 +1114,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block, bool *error + } + + /* Compute the PTS */ +-#ifdef FF_API_PKT_PTS + mtime_t i_pts = frame->pts; +-#else +- mtime_t i_pts = frame->pkt_pts; +-#endif +- if (i_pts == AV_NOPTS_VALUE ) +- i_pts = frame->pkt_dts; +- + if( i_pts == AV_NOPTS_VALUE ) + i_pts = date_Get( &p_sys->pts ); + +-- +GitLab + + +From c0e2450a6ce557f26a44c2da0b7c2ac86984183d Mon Sep 17 00:00:00 2001 +From: Romain Vimont +Date: Tue, 18 Jan 2022 15:08:38 +0100 +Subject: [PATCH 2/8] avcodec: remove thread_safe_callbacks from API 60 + +In current FFmpeg 5.0 (API 59), we must still set the variable, and it +is already deprecated, so we can't get rid of the deprecation warning. + +ffmpeg/a83098ab03a47179d54a9b9c8bcefc81b9c6aafd (deprecation) +ffmpeg/54e5d21acabb452e5680de5db3bf7567d351d68e (doc) +--- + modules/codec/avcodec/video.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c +index c7da048f86..21a8a6be50 100644 +--- a/modules/codec/avcodec/video.c ++++ b/modules/codec/avcodec/video.c +@@ -573,7 +573,9 @@ int InitVideoDec( vlc_object_t *obj ) + i_thread_count = __MIN( i_thread_count, p_codec->id == AV_CODEC_ID_HEVC ? 32 : 16 ); + msg_Dbg( p_dec, "allowing %d thread(s) for decoding", i_thread_count ); + p_context->thread_count = i_thread_count; ++#if LIBAVCODEC_VERSION_MAJOR < 60 + p_context->thread_safe_callbacks = true; ++#endif + + switch( p_codec->id ) + { +-- +GitLab + + +From d24ba02fe8820fa2ba24decee433f52c04fac543 Mon Sep 17 00:00:00 2001 +From: Romain Vimont +Date: Tue, 18 Jan 2022 15:12:26 +0100 +Subject: [PATCH 3/8] avcodec: replace removed FMT_VAAPI_VLD enum value + +Replace AV_PIX_FMT_VAAPI_VLD by AV_PIX_FMT_VAAPI. + +ffmpeg/9f8e57efe4400ca86352277873792792279c3b15 (deprecation) +ffmpeg/ad524cb9eeb298f7a60d923094fbebb1fda7e0e3 (removal) +--- + modules/codec/avcodec/va.c | 2 +- + modules/codec/avcodec/vaapi.c | 4 ++-- + modules/codec/avcodec/video.c | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/modules/codec/avcodec/va.c b/modules/codec/avcodec/va.c +index 05831232d2..beedcc6027 100644 +--- a/modules/codec/avcodec/va.c ++++ b/modules/codec/avcodec/va.c +@@ -37,7 +37,7 @@ vlc_fourcc_t vlc_va_GetChroma(enum PixelFormat hwfmt, enum PixelFormat swfmt) + * fatal, especially not if a software format. */ + switch (hwfmt) + { +- case AV_PIX_FMT_VAAPI_VLD: ++ case AV_PIX_FMT_VAAPI: + switch (swfmt) + { + case AV_PIX_FMT_YUVJ420P: +diff --git a/modules/codec/avcodec/vaapi.c b/modules/codec/avcodec/vaapi.c +index 35e6c47263..3675d2fc79 100644 +--- a/modules/codec/avcodec/vaapi.c ++++ b/modules/codec/avcodec/vaapi.c +@@ -154,7 +154,7 @@ static void Delete(vlc_va_t *va, void **hwctx) + static int Create(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt, + const es_format_t *fmt, picture_sys_t *p_sys) + { +- if (pix_fmt != AV_PIX_FMT_VAAPI_VLD || p_sys == NULL) ++ if (pix_fmt != AV_PIX_FMT_VAAPI || p_sys == NULL) + return VLC_EGENERIC; + + (void) fmt; +@@ -263,7 +263,7 @@ static void DeleteDRM(vlc_va_t *va, void **hwctx) + static int CreateDRM(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt, + const es_format_t *fmt, picture_sys_t *p_sys) + { +- if (pix_fmt != AV_PIX_FMT_VAAPI_VLD || p_sys) ++ if (pix_fmt != AV_PIX_FMT_VAAPI || p_sys) + return VLC_EGENERIC; + + (void) fmt; +diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c +index 21a8a6be50..199af50c6f 100644 +--- a/modules/codec/avcodec/video.c ++++ b/modules/codec/avcodec/video.c +@@ -1613,7 +1613,7 @@ no_reuse: + #endif + AV_PIX_FMT_DXVA2_VLD, + #endif +- AV_PIX_FMT_VAAPI_VLD, ++ AV_PIX_FMT_VAAPI, + #if (LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(52, 4, 0)) + AV_PIX_FMT_VDPAU, + #endif +-- +GitLab + + +From abb9e9a21d9a6d4c952101e45a70182a37fe855e Mon Sep 17 00:00:00 2001 +From: Romain Vimont +Date: Tue, 18 Jan 2022 15:16:39 +0100 +Subject: [PATCH 4/8] avcodec: adapt AVCodec API constification + +Refs ffmpeg/626535f6a169e2d821b969e0ea77125ba7482113 +--- + modules/codec/avcodec/encoder.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c +index c10f44c0c2..46573b17c9 100644 +--- a/modules/codec/avcodec/encoder.c ++++ b/modules/codec/avcodec/encoder.c +@@ -93,7 +93,7 @@ struct encoder_sys_t + /* + * libavcodec properties + */ +- AVCodec *p_codec; ++ const AVCodec *p_codec; + AVCodecContext *p_context; + + /* +@@ -234,7 +234,7 @@ static const int DEFAULT_ALIGN = 0; + /***************************************************************************** + * InitVideoEnc: probe the encoder + *****************************************************************************/ +-static void probe_video_frame_rate( encoder_t *p_enc, AVCodecContext *p_context, AVCodec *p_codec ) ++static void probe_video_frame_rate( encoder_t *p_enc, AVCodecContext *p_context, const AVCodec *p_codec ) + { + /* if we don't have i_frame_rate_base, we are probing and just checking if we can find codec + * so set fps to requested fps if asked by user or input fps is availabled */ +@@ -296,7 +296,7 @@ int InitVideoEnc( vlc_object_t *p_this ) + encoder_t *p_enc = (encoder_t *)p_this; + encoder_sys_t *p_sys; + AVCodecContext *p_context; +- AVCodec *p_codec = NULL; ++ const AVCodec *p_codec = NULL; + unsigned i_codec_id; + const char *psz_namecodec; + float f_val; +-- +GitLab + + +From 83eb99de2bd0a14cfe561106c007bf6e385881c1 Mon Sep 17 00:00:00 2001 +From: Ilkka Ollakka +Date: Fri, 18 Jun 2021 10:08:44 +0300 +Subject: [PATCH 5/8] avcodec: move picture type to use sidedata on encoding + +Sidedata AV_PKT_DATA_QUALITY_STATS has been present since 2015 on +version 56.51.100. Also previous coded_frame->pict_type doesn't seem to +be present anymore in ffmpeg master. + +(cherry picked from commit 8ed4f2a7a2dbc9522c3feebb39b2e4ccc7bf5d24) + +Refs ffmpeg/11bc79089378a5ec00547d0f85bc152afdf30dfa +--- + modules/codec/avcodec/encoder.c | 44 +++++++++++++++++---------------- + 1 file changed, 23 insertions(+), 21 deletions(-) + +diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c +index 46573b17c9..5ea65de787 100644 +--- a/modules/codec/avcodec/encoder.c ++++ b/modules/codec/avcodec/encoder.c +@@ -1101,6 +1101,29 @@ static block_t *vlc_av_packet_Wrap(AVPacket *packet, mtime_t i_length, AVCodecCo + p_block->i_pts = p_block->i_pts * CLOCK_FREQ * context->time_base.num / context->time_base.den; + p_block->i_dts = p_block->i_dts * CLOCK_FREQ * context->time_base.num / context->time_base.den; + ++ uint8_t *av_packet_sidedata = av_packet_get_side_data(packet, AV_PKT_DATA_QUALITY_STATS, NULL); ++ if( av_packet_sidedata ) ++ { ++ switch ( av_packet_sidedata[4] ) ++ { ++ case AV_PICTURE_TYPE_I: ++ case AV_PICTURE_TYPE_SI: ++ p_block->i_flags |= BLOCK_FLAG_TYPE_I; ++ break; ++ case AV_PICTURE_TYPE_P: ++ case AV_PICTURE_TYPE_SP: ++ p_block->i_flags |= BLOCK_FLAG_TYPE_P; ++ break; ++ case AV_PICTURE_TYPE_B: ++ case AV_PICTURE_TYPE_BI: ++ p_block->i_flags |= BLOCK_FLAG_TYPE_B; ++ break; ++ default: ++ p_block->i_flags |= BLOCK_FLAG_TYPE_PB; ++ } ++ ++ } ++ + return p_block; + } + +@@ -1234,27 +1257,6 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict ) + + block_t *p_block = encode_avframe( p_enc, p_sys, frame ); + +- if( p_block ) +- { +- switch ( p_sys->p_context->coded_frame->pict_type ) +- { +- case AV_PICTURE_TYPE_I: +- case AV_PICTURE_TYPE_SI: +- p_block->i_flags |= BLOCK_FLAG_TYPE_I; +- break; +- case AV_PICTURE_TYPE_P: +- case AV_PICTURE_TYPE_SP: +- p_block->i_flags |= BLOCK_FLAG_TYPE_P; +- break; +- case AV_PICTURE_TYPE_B: +- case AV_PICTURE_TYPE_BI: +- p_block->i_flags |= BLOCK_FLAG_TYPE_B; +- break; +- default: +- p_block->i_flags |= BLOCK_FLAG_TYPE_PB; +- } +- } +- + return p_block; + } + +-- +GitLab + + +From de270df11646414bc4173e1f890492b6887d98ee Mon Sep 17 00:00:00 2001 +From: Romain Vimont +Date: Tue, 18 Jan 2022 15:43:27 +0100 +Subject: [PATCH 6/8] avformat: adapt AVOutputFormat API constification + +Refs ffmpeg/56450a0ee4fdda160f4039fc2ae33edfd27765c9 +--- + modules/demux/avformat/mux.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules/demux/avformat/mux.c b/modules/demux/avformat/mux.c +index 0b00640baf..ff1a5e45ee 100644 +--- a/modules/demux/avformat/mux.c ++++ b/modules/demux/avformat/mux.c +@@ -86,7 +86,7 @@ static int IOWriteTyped(void *opaque, uint8_t *buf, int buf_size, + *****************************************************************************/ + int avformat_OpenMux( vlc_object_t *p_this ) + { +- AVOutputFormat *file_oformat; ++ const AVOutputFormat *file_oformat; + sout_mux_t *p_mux = (sout_mux_t*)p_this; + bool dummy = !strcmp( p_mux->p_access->psz_access, "dummy"); + +-- +GitLab + + +From 657cadbbef00ec9c38528c5948331bb2a0448df3 Mon Sep 17 00:00:00 2001 +From: Mehdi Sabwat +Date: Thu, 9 Apr 2020 21:59:56 +0200 +Subject: [PATCH 7/8] avformat: add support for url field in AvFormatContext + +Since Jan 21, 2018 filename field was deprecated in favor +of `url` which now has no length restrictions. + +From doc/APIChanges: +``` +2018-01-28 - ea3672b7d6 - lavf 58.7.100 - avformat.h + Deprecate AVFormatContext filename field which had limited length, use the + new dynamically allocated url field instead. +``` + +The URL field is freed by libavformat in avformat_free_context() in +avformat_CloseMux(). + +Signed-off-by: Alexandre Janniaux +(cherry picked from commit a2ce2e3a8436845378af3b1828f2bb0fa0f4a268) + +Refs ffmpeg/30f7021aa0be2c978aefb73894b643c9bafbf51c +--- + modules/demux/avformat/mux.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/modules/demux/avformat/mux.c b/modules/demux/avformat/mux.c +index ff1a5e45ee..ffff7bee83 100644 +--- a/modules/demux/avformat/mux.c ++++ b/modules/demux/avformat/mux.c +@@ -90,9 +90,12 @@ int avformat_OpenMux( vlc_object_t *p_this ) + sout_mux_t *p_mux = (sout_mux_t*)p_this; + bool dummy = !strcmp( p_mux->p_access->psz_access, "dummy"); + ++#if ( (LIBAVFORMAT_VERSION_MICRO >= 100) \ ++ && (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 7, 100)) ) + if( dummy && strlen(p_mux->p_access->psz_path) + >= sizeof (((AVFormatContext *)NULL)->filename) ) + return VLC_EGENERIC; ++#endif + + msg_Dbg( p_mux, "using %s %s", AVPROVIDER(LIBAVFORMAT), LIBAVFORMAT_IDENT ); + +@@ -127,7 +130,12 @@ int avformat_OpenMux( vlc_object_t *p_this ) + p_sys->oc->oformat = file_oformat; + /* If we use dummy access, let avformat write output */ + if( dummy ) ++#if ( (LIBAVFORMAT_VERSION_MICRO >= 100) \ ++ && (LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(58, 7, 100)) ) ++ p_sys->oc->url = av_strdup(p_mux->p_access->psz_path); ++#else + strcpy( p_sys->oc->filename, p_mux->p_access->psz_path ); ++#endif + + /* Create I/O wrapper */ + p_sys->io_buffer_size = 10 * 1024 * 1024; /* FIXME */ +-- +GitLab + + +From b42e6cb9c82a74980c7c062b0ee6e07ae51d32af Mon Sep 17 00:00:00 2001 +From: Ilkka Ollakka +Date: Fri, 18 Jun 2021 10:31:00 +0300 +Subject: [PATCH 8/8] avformat: remove pts hack from demuxing + +pstream->cur_dts is no longer available from libavformat + +(cherry picked from commit c2ba623f0ad425e7743fca0bdc251d5bc9289e77) + +Refs ffmpeg/591b88e6787c4e678237f02a50421d101abd25c2 +--- + modules/demux/avformat/mux.c | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/modules/demux/avformat/mux.c b/modules/demux/avformat/mux.c +index ffff7bee83..8dd8c2f7e6 100644 +--- a/modules/demux/avformat/mux.c ++++ b/modules/demux/avformat/mux.c +@@ -379,10 +379,6 @@ static int MuxBlock( sout_mux_t *p_mux, sout_input_t *p_input ) + 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 ) + { + msg_Err( p_mux, "could not write frame (pts: %"PRId64", dts: %"PRId64") " +-- +GitLab + From 0d3efe4b945a79b5e0c1feac9f5f3c15ff08728d Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Tue, 18 Jan 2022 17:50:51 +0100 Subject: [PATCH 17/24] Apply patch --- vlc.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vlc.spec b/vlc.spec index 024fd60..978c350 100644 --- a/vlc.spec +++ b/vlc.spec @@ -78,6 +78,7 @@ Patch11: 0001-Revert-configure-ignore-too-new-SRT.patch Patch12: 0001-Revert-access-libdvdread-6.1.2-supports-UTF-8-paths-.patch # https://code.videolan.org/videolan/vlc/-/issues/25473#note_256576 Patch13: 0001-Get-addr-by-ref.-from-getConnectionEndpointAddress.patch +Patch14: https://code.videolan.org/videolan/vlc/-/merge_requests/1245.patch BuildRequires: desktop-file-utils BuildRequires: libappstream-glib @@ -358,6 +359,7 @@ sed -i -e 's/luac/luac-5.1/g' configure.ac %endif %if 0%{?fedora} > 35 %patch13 -p1 +%patch14 -p1 %endif %{?_with_bootstrap: From 224705741e9b94d65110d9df88261f241f4c1fb1 Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Tue, 18 Jan 2022 17:51:06 +0100 Subject: [PATCH 18/24] Bump --- vlc.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vlc.spec b/vlc.spec index 978c350..ae97266 100644 --- a/vlc.spec +++ b/vlc.spec @@ -51,7 +51,7 @@ Summary: The cross-platform open-source multimedia framework, player and server Epoch: 1 Name: vlc Version: 3.0.17 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ URL: https://www.videolan.org %if 0%{?commit0:1} @@ -625,6 +625,9 @@ fi || : %changelog +* Tue Jan 18 2022 Nicolas Chauvet - 1:3.0.17-4 +- Bump + * Sat Jan 15 2022 Leigh Scott - 1:3.0.17-3 - Update 3.x snapshot From 43434e55afa766c0198bc81d3423d0bf3375f830 Mon Sep 17 00:00:00 2001 From: Leigh Scott Date: Wed, 19 Jan 2022 01:10:07 +0000 Subject: [PATCH 19/24] fix --- 1244.patch | 259 +++++++++++++++++++++++++++++++++++++++ Remove_legacy_caca.patch | 98 +++++++++++++++ vlc.spec | 5 + 3 files changed, 362 insertions(+) create mode 100644 1244.patch create mode 100644 Remove_legacy_caca.patch diff --git a/1244.patch b/1244.patch new file mode 100644 index 0000000..f73550b --- /dev/null +++ b/1244.patch @@ -0,0 +1,259 @@ +From 110d69c8245bb2bc1f0cf183dcdd6ba636973bfc Mon Sep 17 00:00:00 2001 +From: Niklas Haas +Date: Tue, 18 Jan 2022 16:47:22 +0100 +Subject: [PATCH 1/4] Revert "opengl: vout_helper: use pl_gpu_dummy for + shaders" + +This reverts commit 2437484d7684a4661048df1e095484a276bbea0b. + +The referenced commit is not a good way of fixing the issue described in +its commit message. Attaching a dummy GPU to the pl_shader makes the +shader think a GPU is actually available, and can lead to e.g. the use +of a dither texture (which VLC has no mapping code for, and would thus +result in a shader compilation error). + +All of the queried limits are also irrelevant for the way we use shaders +in this code, since they only affect GPU resources (which we can't use) +or texture sampling (which we don't use). + +Fixes #26503 by removing the conflicting code +--- + modules/video_output/opengl/converter.h | 1 - + modules/video_output/opengl/vout_helper.c | 78 +---------------------- + 2 files changed, 2 insertions(+), 77 deletions(-) + +diff --git a/modules/video_output/opengl/converter.h b/modules/video_output/opengl/converter.h +index f8f0c12024..b69807f8cd 100644 +--- a/modules/video_output/opengl/converter.h ++++ b/modules/video_output/opengl/converter.h +@@ -340,7 +340,6 @@ struct opengl_tex_converter_t + bool yuv_color; + GLfloat yuv_coefficients[16]; + +- const struct pl_gpu *pl_gpu; + struct pl_shader *pl_sh; + const struct pl_shader_res *pl_sh_res; + +diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c +index bf07c1c03f..711a14b7ae 100644 +--- a/modules/video_output/opengl/vout_helper.c ++++ b/modules/video_output/opengl/vout_helper.c +@@ -44,12 +44,6 @@ + #include "vout_helper.h" + #include "internal.h" + +-#if HAVE_LIBPLACEBO +-#if PL_API_VER >= 18 +-#include +-#endif +-#endif +- + #ifndef GL_CLAMP_TO_EDGE + # define GL_CLAMP_TO_EDGE 0x812F + #endif +@@ -576,10 +570,6 @@ opengl_deinit_program(vout_display_opengl_t *vgl, struct prgm *prgm) + + #ifdef HAVE_LIBPLACEBO + FREENULL(tc->uloc.pl_vars); +-#if PL_API_VER >= 18 +- if (tc->pl_gpu) +- pl_gpu_dummy_destroy(&tc->pl_gpu); +-#endif + if (tc->pl_ctx) + pl_context_destroy(&tc->pl_ctx); + #endif +@@ -632,78 +622,14 @@ opengl_init_program(vout_display_opengl_t *vgl, struct prgm *prgm, + // create the main libplacebo context + if (!subpics) + { +-#if PL_API_VER >= 18 +- struct pl_gpu_dummy_params gpu_dummy_params = { +- .caps = PL_GPU_CAP_INPUT_VARIABLES, +- .glsl = (struct pl_glsl_desc) { +-#ifdef USE_OPENGL_ES2 +- .version = 100, +- .gles = true, +-#else +- .version = 120, +-#endif +- .vulkan = false, +- }, +- .limits = { 0 } +- }; +-#endif +- +- const opengl_vtable_t *vt = tc->vt; +- +-#if PL_API_VER >= 18 +- vt->GetIntegerv(GL_MAX_TEXTURE_SIZE, +- (GLint *)&gpu_dummy_params.limits.max_tex_1d_dim); +- gpu_dummy_params.limits.max_tex_2d_dim = gpu_dummy_params.limits.max_tex_1d_dim; +-#ifndef USE_OPENGL_ES2 +- vt->GetIntegerv(GL_MAX_3D_TEXTURE_SIZE, +- (GLint *)&gpu_dummy_params.limits.max_tex_3d_dim); +- vt->GetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, +- (GLint *)&gpu_dummy_params.limits.max_ubo_size); +- vt->GetIntegerv(GL_MAX_SHADER_STORAGE_BLOCK_SIZE, +- (GLint *)&gpu_dummy_params.limits.max_ssbo_size); +- vt->GetIntegerv(GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB, +- (GLint *)&gpu_dummy_params.limits.min_gather_offset); +- vt->GetIntegerv(GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB, +- (GLint *)&gpu_dummy_params.limits.max_gather_offset); +- vt->GetIntegerv(GL_MAX_COMPUTE_SHARED_MEMORY_SIZE, +- (GLint *)&gpu_dummy_params.limits.max_shmem_size); +- vt->GetIntegerv(GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS, +- (GLint *)&gpu_dummy_params.limits.max_group_threads); +- if (vt->GetIntegeri_v != NULL) +- { +- for (int i = 0; i < 3; i++) +- { +- vt->GetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, i, +- (GLint *)&gpu_dummy_params.limits.max_dispatch[i]); +- vt->GetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, i, +- (GLint *)&gpu_dummy_params.limits.max_group_size[i]); +- } +- } +-#endif +-#endif +- +- /* Drain potential errors, non-existing variables will be set to zero */ +- while (vt->GetError() != GL_NO_ERROR) {} +- + tc->pl_ctx = pl_context_create(PL_API_VER, &(struct pl_context_params) { + .log_cb = log_cb, + .log_priv = tc, + .log_level = PL_LOG_INFO, + }); +- + if (tc->pl_ctx) { +-#if PL_API_VER >= 18 +- /* pl_gpu = NULL is not fatal but might generate incorrect shaders +- * depending or more recent GLSL version than VLC shaders. */ +- tc->pl_gpu = pl_gpu_dummy_create(tc->pl_ctx, &gpu_dummy_params); +- +- struct pl_shader_params shader_params = { +- .gpu = tc->pl_gpu, +- }; +-#endif +- + # if PL_API_VER >= 20 +- tc->pl_sh = pl_shader_alloc(tc->pl_ctx, &shader_params); ++ tc->pl_sh = pl_shader_alloc(tc->pl_ctx, NULL); + # elif PL_API_VER >= 6 + tc->pl_sh = pl_shader_alloc(tc->pl_ctx, NULL, 0); + # else +@@ -861,7 +787,7 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt, + GET_PROC_ADDR_CORE(GetError); + GET_PROC_ADDR_CORE(GetIntegerv); + #ifndef USE_OPENGL_ES2 +- GET_PROC_ADDR_OPTIONAL(GetIntegeri_v); ++ GET_PROC_ADDR_CORE(GetIntegeri_v); + #endif + GET_PROC_ADDR_CORE(GetString); + GET_PROC_ADDR_CORE(PixelStorei); +-- +GitLab + + +From 6d145e38c03d4ffa5b6bff31e358a5ca6ceb3461 Mon Sep 17 00:00:00 2001 +From: Niklas Haas +Date: Tue, 18 Jan 2022 17:07:25 +0100 +Subject: [PATCH 2/4] opengl: vout_helper: use pl_shader_params.glsl + +This is the proper way to limit the GLSL version when using standalone +shaders without an associated GPU backend. +--- + modules/video_output/opengl/vout_helper.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c +index 711a14b7ae..a98621a859 100644 +--- a/modules/video_output/opengl/vout_helper.c ++++ b/modules/video_output/opengl/vout_helper.c +@@ -629,7 +629,10 @@ opengl_init_program(vout_display_opengl_t *vgl, struct prgm *prgm, + }); + if (tc->pl_ctx) { + # if PL_API_VER >= 20 +- tc->pl_sh = pl_shader_alloc(tc->pl_ctx, NULL); ++ tc->pl_sh = pl_shader_alloc(tc->pl_ctx, &(struct pl_shader_params) { ++ .glsl.version = tc->glsl_version, ++ .glsl.gles = tc->is_gles, ++ }); + # elif PL_API_VER >= 6 + tc->pl_sh = pl_shader_alloc(tc->pl_ctx, NULL, 0); + # else +-- +GitLab + + +From 645cbd6fac5bd07d1c973be9fc048b0f329c087c Mon Sep 17 00:00:00 2001 +From: Niklas Haas +Date: Tue, 18 Jan 2022 17:19:27 +0100 +Subject: [PATCH 3/4] opengl: don't error on no-op libplacebo shader + +See 6efc345d81a12 +--- + modules/video_output/opengl/fragment_shaders.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/modules/video_output/opengl/fragment_shaders.c b/modules/video_output/opengl/fragment_shaders.c +index e0b98732ca..ecf7226f0e 100644 +--- a/modules/video_output/opengl/fragment_shaders.c ++++ b/modules/video_output/opengl/fragment_shaders.c +@@ -765,8 +765,8 @@ opengl_fragment_shader_init_impl(opengl_tex_converter_t *tc, GLenum tex_target, + } + + #ifdef HAVE_LIBPLACEBO +- if (tc->pl_sh_res) { +- const struct pl_shader_res *res = tc->pl_sh_res; ++ const struct pl_shader_res *res = tc->pl_sh_res; ++ if (res && res->input != PL_SHADER_SIG_NONE) { + assert(res->input == PL_SHADER_SIG_COLOR); + assert(res->output == PL_SHADER_SIG_COLOR); + ADDF(" result = %s(result);\n", res->name); +-- +GitLab + + +From 37bf74e6645d3023c1ebcbd81ffae1e552d3a73e Mon Sep 17 00:00:00 2001 +From: Niklas Haas +Date: Tue, 18 Jan 2022 18:03:48 +0100 +Subject: [PATCH 4/4] opengl: drop unneeded GetIntegeri_v + +This causes issues on some platforms, and we don't need it +--- + modules/video_output/opengl/converter.h | 3 --- + modules/video_output/opengl/vout_helper.c | 3 --- + 2 files changed, 6 deletions(-) + +diff --git a/modules/video_output/opengl/converter.h b/modules/video_output/opengl/converter.h +index b69807f8cd..7000e1f38e 100644 +--- a/modules/video_output/opengl/converter.h ++++ b/modules/video_output/opengl/converter.h +@@ -167,9 +167,6 @@ typedef struct { + PFNGLGENTEXTURESPROC GenTextures; + PFNGLGETERRORPROC GetError; + PFNGLGETINTEGERVPROC GetIntegerv; +-#ifndef USE_OPENGL_ES2 +- PFNGLGETINTEGERIVPROC GetIntegeri_v; +-#endif + PFNGLGETSTRINGPROC GetString; + PFNGLPIXELSTOREIPROC PixelStorei; + PFNGLTEXIMAGE2DPROC TexImage2D; +diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c +index a98621a859..13d65e04c8 100644 +--- a/modules/video_output/opengl/vout_helper.c ++++ b/modules/video_output/opengl/vout_helper.c +@@ -789,9 +789,6 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt, + GET_PROC_ADDR_CORE(GenTextures); + GET_PROC_ADDR_CORE(GetError); + GET_PROC_ADDR_CORE(GetIntegerv); +-#ifndef USE_OPENGL_ES2 +- GET_PROC_ADDR_CORE(GetIntegeri_v); +-#endif + GET_PROC_ADDR_CORE(GetString); + GET_PROC_ADDR_CORE(PixelStorei); + GET_PROC_ADDR_CORE(TexImage2D); +-- +GitLab + diff --git a/Remove_legacy_caca.patch b/Remove_legacy_caca.patch new file mode 100644 index 0000000..8374e71 --- /dev/null +++ b/Remove_legacy_caca.patch @@ -0,0 +1,98 @@ +diff -uNrp a/modules/video_output/caca.c b/modules/video_output/caca.c +--- a/modules/video_output/caca.c 2022-01-14 06:09:28.000000000 +0000 ++++ b/modules/video_output/caca.c 2022-01-18 23:09:44.979137301 +0000 +@@ -74,9 +74,9 @@ static void Place(vout_display_t *, vout + + /* */ + struct vout_display_sys_t { +- cucul_canvas_t *cv; ++ caca_canvas_t *cv; + caca_display_t *dp; +- cucul_dither_t *dither; ++ caca_dither_t *dither; + + picture_pool_t *pool; + vout_display_event_thread_t *et; +@@ -153,9 +153,9 @@ static int Open(vlc_object_t *object) + if (!sys) + goto error; + +- sys->cv = cucul_create_canvas(0, 0); ++ sys->cv = caca_create_canvas(0, 0); + if (!sys->cv) { +- msg_Err(vd, "cannot initialize libcucul"); ++ msg_Err(vd, "cannot initialize libcaca"); + goto error; + } + +@@ -209,11 +209,11 @@ error: + if (sys->pool) + picture_pool_Release(sys->pool); + if (sys->dither) +- cucul_free_dither(sys->dither); ++ caca_free_dither(sys->dither); + if (sys->dp) + caca_free_display(sys->dp); + if (sys->cv) +- cucul_free_canvas(sys->cv); ++ caca_free_canvas(sys->cv); + + free(sys); + } +@@ -235,9 +235,9 @@ static void Close(vlc_object_t *object) + if (sys->pool) + picture_pool_Release(sys->pool); + if (sys->dither) +- cucul_free_dither(sys->dither); ++ caca_free_dither(sys->dither); + caca_free_display(sys->dp); +- cucul_free_canvas(sys->cv); ++ caca_free_canvas(sys->cv); + + #if defined(_WIN32) + FreeConsole(); +@@ -266,7 +266,7 @@ static void Prepare(vout_display_t *vd, + + if (!sys->dither) { + /* Create the libcaca dither object */ +- sys->dither = cucul_create_dither(32, ++ sys->dither = caca_create_dither(32, + vd->source.i_visible_width, + vd->source.i_visible_height, + picture->p[0].i_pitch, +@@ -284,12 +284,12 @@ static void Prepare(vout_display_t *vd, + vout_display_place_t place; + Place(vd, &place); + +- cucul_set_color_ansi(sys->cv, CUCUL_COLOR_DEFAULT, CUCUL_COLOR_BLACK); +- cucul_clear_canvas(sys->cv); ++ caca_set_color_ansi(sys->cv, CACA_DEFAULT, CACA_BLACK); ++ caca_clear_canvas(sys->cv); + + const int crop_offset = vd->source.i_y_offset * picture->p->i_pitch + + vd->source.i_x_offset * picture->p->i_pixel_pitch; +- cucul_dither_bitmap(sys->cv, place.x, place.y, ++ caca_dither_bitmap(sys->cv, place.x, place.y, + place.width, place.height, + sys->dither, + &picture->p->p_pixels[crop_offset]); +@@ -328,7 +328,7 @@ static int Control(vout_display_t *vd, i + + case VOUT_DISPLAY_CHANGE_SOURCE_CROP: + if (sys->dither) +- cucul_free_dither(sys->dither); ++ caca_free_dither(sys->dither); + sys->dither = NULL; + return VLC_SUCCESS; + +@@ -366,8 +366,8 @@ static void Place(vout_display_t *vd, vo + + vout_display_PlacePicture(place, &vd->source, vd->cfg, false); + +- const int canvas_width = cucul_get_canvas_width(sys->cv); +- const int canvas_height = cucul_get_canvas_height(sys->cv); ++ const int canvas_width = caca_get_canvas_width(sys->cv); ++ const int canvas_height = caca_get_canvas_height(sys->cv); + const int display_width = caca_get_display_width(sys->dp); + const int display_height = caca_get_display_height(sys->dp); + diff --git a/vlc.spec b/vlc.spec index ae97266..6241c57 100644 --- a/vlc.spec +++ b/vlc.spec @@ -79,6 +79,9 @@ Patch12: 0001-Revert-access-libdvdread-6.1.2-supports-UTF-8-paths-.patch # https://code.videolan.org/videolan/vlc/-/issues/25473#note_256576 Patch13: 0001-Get-addr-by-ref.-from-getConnectionEndpointAddress.patch Patch14: https://code.videolan.org/videolan/vlc/-/merge_requests/1245.patch +# https://code.videolan.org/videolan/vlc/-/merge_requests/889 +Patch15: Remove_legacy_caca.patch +Patch16: https://code.videolan.org/videolan/vlc/-/merge_requests/1244.patch BuildRequires: desktop-file-utils BuildRequires: libappstream-glib @@ -360,6 +363,8 @@ sed -i -e 's/luac/luac-5.1/g' configure.ac %if 0%{?fedora} > 35 %patch13 -p1 %patch14 -p1 +%patch15 -p1 +%patch16 -p1 %endif %{?_with_bootstrap: From 2bdfb5987597dc4659592f08a90144c6fb513f6b Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Wed, 19 Jan 2022 09:32:58 +0100 Subject: [PATCH 20/24] Reword conditions --- vlc.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vlc.spec b/vlc.spec index 6241c57..f69c2ef 100644 --- a/vlc.spec +++ b/vlc.spec @@ -160,7 +160,7 @@ BuildRequires: libtiff-devel BuildRequires: pkgconfig(libidn) BuildRequires: pkgconfig(libjpeg) # Not Yet in EL8 -%if 0%{?fedora} || 0%{?el7} +%if ! 0%{?el8} BuildRequires: pkgconfig(libplacebo) %endif BuildRequires: pkgconfig(libudev) @@ -180,7 +180,7 @@ BuildRequires: pkgconfig(gl) BuildRequires: pkgconfig(glu) BuildRequires: libsamplerate-devel BuildRequires: libshout-devel -%if 0%{?fedora} || 0%{?rhel} > 7 +%if 0%{?fedora} || 0%{?el8} BuildRequires: lua5.1-devel, lua5.1 %else BuildRequires: lua-devel @@ -197,7 +197,7 @@ BuildRequires: pkgconfig(libpulse) >= 0.9.8 BuildRequires: pkgconfig(libsecret-1) >= 0.18 BuildRequires: pkgconfig(microdns) >= 0.1.2 BuildRequires: pkgconfig(protobuf-lite) >= 2.5 -%if 0%{?fedora} > 32 +%if 0%{?fedora} BuildRequires: qt5-qtbase-private-devel %endif BuildRequires: pkgconfig(Qt5Core) >= 5.5 From 62442a1680ad0192af5b15dc5667ccc58a06cccb Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Wed, 19 Jan 2022 09:34:13 +0100 Subject: [PATCH 21/24] Rebuilt --- vlc.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vlc.spec b/vlc.spec index f69c2ef..436b855 100644 --- a/vlc.spec +++ b/vlc.spec @@ -51,7 +51,7 @@ Summary: The cross-platform open-source multimedia framework, player and server Epoch: 1 Name: vlc Version: 3.0.17 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv2+ URL: https://www.videolan.org %if 0%{?commit0:1} @@ -630,6 +630,9 @@ fi || : %changelog +* Wed Jan 19 2022 Nicolas Chauvet - 1:3.0.17-5 +- rebuilt + * Tue Jan 18 2022 Nicolas Chauvet - 1:3.0.17-4 - Bump From 285ea575b7d16934b561730b66316fd73bbd6736 Mon Sep 17 00:00:00 2001 From: Leigh Scott Date: Fri, 4 Feb 2022 18:16:02 +0000 Subject: [PATCH 22/24] Rebuild --- 1244.patch | 259 ------------------------------------ 1245.patch | 382 ----------------------------------------------------- sources | 2 +- vlc.spec | 13 +- 4 files changed, 7 insertions(+), 649 deletions(-) delete mode 100644 1244.patch delete mode 100644 1245.patch diff --git a/1244.patch b/1244.patch deleted file mode 100644 index f73550b..0000000 --- a/1244.patch +++ /dev/null @@ -1,259 +0,0 @@ -From 110d69c8245bb2bc1f0cf183dcdd6ba636973bfc Mon Sep 17 00:00:00 2001 -From: Niklas Haas -Date: Tue, 18 Jan 2022 16:47:22 +0100 -Subject: [PATCH 1/4] Revert "opengl: vout_helper: use pl_gpu_dummy for - shaders" - -This reverts commit 2437484d7684a4661048df1e095484a276bbea0b. - -The referenced commit is not a good way of fixing the issue described in -its commit message. Attaching a dummy GPU to the pl_shader makes the -shader think a GPU is actually available, and can lead to e.g. the use -of a dither texture (which VLC has no mapping code for, and would thus -result in a shader compilation error). - -All of the queried limits are also irrelevant for the way we use shaders -in this code, since they only affect GPU resources (which we can't use) -or texture sampling (which we don't use). - -Fixes #26503 by removing the conflicting code ---- - modules/video_output/opengl/converter.h | 1 - - modules/video_output/opengl/vout_helper.c | 78 +---------------------- - 2 files changed, 2 insertions(+), 77 deletions(-) - -diff --git a/modules/video_output/opengl/converter.h b/modules/video_output/opengl/converter.h -index f8f0c12024..b69807f8cd 100644 ---- a/modules/video_output/opengl/converter.h -+++ b/modules/video_output/opengl/converter.h -@@ -340,7 +340,6 @@ struct opengl_tex_converter_t - bool yuv_color; - GLfloat yuv_coefficients[16]; - -- const struct pl_gpu *pl_gpu; - struct pl_shader *pl_sh; - const struct pl_shader_res *pl_sh_res; - -diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c -index bf07c1c03f..711a14b7ae 100644 ---- a/modules/video_output/opengl/vout_helper.c -+++ b/modules/video_output/opengl/vout_helper.c -@@ -44,12 +44,6 @@ - #include "vout_helper.h" - #include "internal.h" - --#if HAVE_LIBPLACEBO --#if PL_API_VER >= 18 --#include --#endif --#endif -- - #ifndef GL_CLAMP_TO_EDGE - # define GL_CLAMP_TO_EDGE 0x812F - #endif -@@ -576,10 +570,6 @@ opengl_deinit_program(vout_display_opengl_t *vgl, struct prgm *prgm) - - #ifdef HAVE_LIBPLACEBO - FREENULL(tc->uloc.pl_vars); --#if PL_API_VER >= 18 -- if (tc->pl_gpu) -- pl_gpu_dummy_destroy(&tc->pl_gpu); --#endif - if (tc->pl_ctx) - pl_context_destroy(&tc->pl_ctx); - #endif -@@ -632,78 +622,14 @@ opengl_init_program(vout_display_opengl_t *vgl, struct prgm *prgm, - // create the main libplacebo context - if (!subpics) - { --#if PL_API_VER >= 18 -- struct pl_gpu_dummy_params gpu_dummy_params = { -- .caps = PL_GPU_CAP_INPUT_VARIABLES, -- .glsl = (struct pl_glsl_desc) { --#ifdef USE_OPENGL_ES2 -- .version = 100, -- .gles = true, --#else -- .version = 120, --#endif -- .vulkan = false, -- }, -- .limits = { 0 } -- }; --#endif -- -- const opengl_vtable_t *vt = tc->vt; -- --#if PL_API_VER >= 18 -- vt->GetIntegerv(GL_MAX_TEXTURE_SIZE, -- (GLint *)&gpu_dummy_params.limits.max_tex_1d_dim); -- gpu_dummy_params.limits.max_tex_2d_dim = gpu_dummy_params.limits.max_tex_1d_dim; --#ifndef USE_OPENGL_ES2 -- vt->GetIntegerv(GL_MAX_3D_TEXTURE_SIZE, -- (GLint *)&gpu_dummy_params.limits.max_tex_3d_dim); -- vt->GetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, -- (GLint *)&gpu_dummy_params.limits.max_ubo_size); -- vt->GetIntegerv(GL_MAX_SHADER_STORAGE_BLOCK_SIZE, -- (GLint *)&gpu_dummy_params.limits.max_ssbo_size); -- vt->GetIntegerv(GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB, -- (GLint *)&gpu_dummy_params.limits.min_gather_offset); -- vt->GetIntegerv(GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB, -- (GLint *)&gpu_dummy_params.limits.max_gather_offset); -- vt->GetIntegerv(GL_MAX_COMPUTE_SHARED_MEMORY_SIZE, -- (GLint *)&gpu_dummy_params.limits.max_shmem_size); -- vt->GetIntegerv(GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS, -- (GLint *)&gpu_dummy_params.limits.max_group_threads); -- if (vt->GetIntegeri_v != NULL) -- { -- for (int i = 0; i < 3; i++) -- { -- vt->GetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, i, -- (GLint *)&gpu_dummy_params.limits.max_dispatch[i]); -- vt->GetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, i, -- (GLint *)&gpu_dummy_params.limits.max_group_size[i]); -- } -- } --#endif --#endif -- -- /* Drain potential errors, non-existing variables will be set to zero */ -- while (vt->GetError() != GL_NO_ERROR) {} -- - tc->pl_ctx = pl_context_create(PL_API_VER, &(struct pl_context_params) { - .log_cb = log_cb, - .log_priv = tc, - .log_level = PL_LOG_INFO, - }); -- - if (tc->pl_ctx) { --#if PL_API_VER >= 18 -- /* pl_gpu = NULL is not fatal but might generate incorrect shaders -- * depending or more recent GLSL version than VLC shaders. */ -- tc->pl_gpu = pl_gpu_dummy_create(tc->pl_ctx, &gpu_dummy_params); -- -- struct pl_shader_params shader_params = { -- .gpu = tc->pl_gpu, -- }; --#endif -- - # if PL_API_VER >= 20 -- tc->pl_sh = pl_shader_alloc(tc->pl_ctx, &shader_params); -+ tc->pl_sh = pl_shader_alloc(tc->pl_ctx, NULL); - # elif PL_API_VER >= 6 - tc->pl_sh = pl_shader_alloc(tc->pl_ctx, NULL, 0); - # else -@@ -861,7 +787,7 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt, - GET_PROC_ADDR_CORE(GetError); - GET_PROC_ADDR_CORE(GetIntegerv); - #ifndef USE_OPENGL_ES2 -- GET_PROC_ADDR_OPTIONAL(GetIntegeri_v); -+ GET_PROC_ADDR_CORE(GetIntegeri_v); - #endif - GET_PROC_ADDR_CORE(GetString); - GET_PROC_ADDR_CORE(PixelStorei); --- -GitLab - - -From 6d145e38c03d4ffa5b6bff31e358a5ca6ceb3461 Mon Sep 17 00:00:00 2001 -From: Niklas Haas -Date: Tue, 18 Jan 2022 17:07:25 +0100 -Subject: [PATCH 2/4] opengl: vout_helper: use pl_shader_params.glsl - -This is the proper way to limit the GLSL version when using standalone -shaders without an associated GPU backend. ---- - modules/video_output/opengl/vout_helper.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c -index 711a14b7ae..a98621a859 100644 ---- a/modules/video_output/opengl/vout_helper.c -+++ b/modules/video_output/opengl/vout_helper.c -@@ -629,7 +629,10 @@ opengl_init_program(vout_display_opengl_t *vgl, struct prgm *prgm, - }); - if (tc->pl_ctx) { - # if PL_API_VER >= 20 -- tc->pl_sh = pl_shader_alloc(tc->pl_ctx, NULL); -+ tc->pl_sh = pl_shader_alloc(tc->pl_ctx, &(struct pl_shader_params) { -+ .glsl.version = tc->glsl_version, -+ .glsl.gles = tc->is_gles, -+ }); - # elif PL_API_VER >= 6 - tc->pl_sh = pl_shader_alloc(tc->pl_ctx, NULL, 0); - # else --- -GitLab - - -From 645cbd6fac5bd07d1c973be9fc048b0f329c087c Mon Sep 17 00:00:00 2001 -From: Niklas Haas -Date: Tue, 18 Jan 2022 17:19:27 +0100 -Subject: [PATCH 3/4] opengl: don't error on no-op libplacebo shader - -See 6efc345d81a12 ---- - modules/video_output/opengl/fragment_shaders.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/modules/video_output/opengl/fragment_shaders.c b/modules/video_output/opengl/fragment_shaders.c -index e0b98732ca..ecf7226f0e 100644 ---- a/modules/video_output/opengl/fragment_shaders.c -+++ b/modules/video_output/opengl/fragment_shaders.c -@@ -765,8 +765,8 @@ opengl_fragment_shader_init_impl(opengl_tex_converter_t *tc, GLenum tex_target, - } - - #ifdef HAVE_LIBPLACEBO -- if (tc->pl_sh_res) { -- const struct pl_shader_res *res = tc->pl_sh_res; -+ const struct pl_shader_res *res = tc->pl_sh_res; -+ if (res && res->input != PL_SHADER_SIG_NONE) { - assert(res->input == PL_SHADER_SIG_COLOR); - assert(res->output == PL_SHADER_SIG_COLOR); - ADDF(" result = %s(result);\n", res->name); --- -GitLab - - -From 37bf74e6645d3023c1ebcbd81ffae1e552d3a73e Mon Sep 17 00:00:00 2001 -From: Niklas Haas -Date: Tue, 18 Jan 2022 18:03:48 +0100 -Subject: [PATCH 4/4] opengl: drop unneeded GetIntegeri_v - -This causes issues on some platforms, and we don't need it ---- - modules/video_output/opengl/converter.h | 3 --- - modules/video_output/opengl/vout_helper.c | 3 --- - 2 files changed, 6 deletions(-) - -diff --git a/modules/video_output/opengl/converter.h b/modules/video_output/opengl/converter.h -index b69807f8cd..7000e1f38e 100644 ---- a/modules/video_output/opengl/converter.h -+++ b/modules/video_output/opengl/converter.h -@@ -167,9 +167,6 @@ typedef struct { - PFNGLGENTEXTURESPROC GenTextures; - PFNGLGETERRORPROC GetError; - PFNGLGETINTEGERVPROC GetIntegerv; --#ifndef USE_OPENGL_ES2 -- PFNGLGETINTEGERIVPROC GetIntegeri_v; --#endif - PFNGLGETSTRINGPROC GetString; - PFNGLPIXELSTOREIPROC PixelStorei; - PFNGLTEXIMAGE2DPROC TexImage2D; -diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c -index a98621a859..13d65e04c8 100644 ---- a/modules/video_output/opengl/vout_helper.c -+++ b/modules/video_output/opengl/vout_helper.c -@@ -789,9 +789,6 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt, - GET_PROC_ADDR_CORE(GenTextures); - GET_PROC_ADDR_CORE(GetError); - GET_PROC_ADDR_CORE(GetIntegerv); --#ifndef USE_OPENGL_ES2 -- GET_PROC_ADDR_CORE(GetIntegeri_v); --#endif - GET_PROC_ADDR_CORE(GetString); - GET_PROC_ADDR_CORE(PixelStorei); - GET_PROC_ADDR_CORE(TexImage2D); --- -GitLab - diff --git a/1245.patch b/1245.patch deleted file mode 100644 index d4bb33d..0000000 --- a/1245.patch +++ /dev/null @@ -1,382 +0,0 @@ -From dbf942baa1169affbb32094cbdeecee488971a13 Mon Sep 17 00:00:00 2001 -From: Romain Vimont -Date: Tue, 18 Jan 2022 15:06:28 +0100 -Subject: [PATCH 1/8] avcodec: use AVFrame.pts - -> Decoders now export the frame timestamp as AVFrame.pts. It was -> previously exported as AVFrame.pkt_pts, which is now deprecated. - -Refs ffmpeg/32c8359093d1ff4f45ed19518b449b3ac3769d27 (deprecation) -Refs ffmpeg/6e30b35b85b81c802e52a1078ec7a3097e353c6d (removal) ---- - modules/codec/avcodec/video.c | 7 ------- - 1 file changed, 7 deletions(-) - -diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c -index 2b1e3ad314..c7da048f86 100644 ---- a/modules/codec/avcodec/video.c -+++ b/modules/codec/avcodec/video.c -@@ -1114,14 +1114,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block, bool *error - } - - /* Compute the PTS */ --#ifdef FF_API_PKT_PTS - mtime_t i_pts = frame->pts; --#else -- mtime_t i_pts = frame->pkt_pts; --#endif -- if (i_pts == AV_NOPTS_VALUE ) -- i_pts = frame->pkt_dts; -- - if( i_pts == AV_NOPTS_VALUE ) - i_pts = date_Get( &p_sys->pts ); - --- -GitLab - - -From c0e2450a6ce557f26a44c2da0b7c2ac86984183d Mon Sep 17 00:00:00 2001 -From: Romain Vimont -Date: Tue, 18 Jan 2022 15:08:38 +0100 -Subject: [PATCH 2/8] avcodec: remove thread_safe_callbacks from API 60 - -In current FFmpeg 5.0 (API 59), we must still set the variable, and it -is already deprecated, so we can't get rid of the deprecation warning. - -ffmpeg/a83098ab03a47179d54a9b9c8bcefc81b9c6aafd (deprecation) -ffmpeg/54e5d21acabb452e5680de5db3bf7567d351d68e (doc) ---- - modules/codec/avcodec/video.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c -index c7da048f86..21a8a6be50 100644 ---- a/modules/codec/avcodec/video.c -+++ b/modules/codec/avcodec/video.c -@@ -573,7 +573,9 @@ int InitVideoDec( vlc_object_t *obj ) - i_thread_count = __MIN( i_thread_count, p_codec->id == AV_CODEC_ID_HEVC ? 32 : 16 ); - msg_Dbg( p_dec, "allowing %d thread(s) for decoding", i_thread_count ); - p_context->thread_count = i_thread_count; -+#if LIBAVCODEC_VERSION_MAJOR < 60 - p_context->thread_safe_callbacks = true; -+#endif - - switch( p_codec->id ) - { --- -GitLab - - -From d24ba02fe8820fa2ba24decee433f52c04fac543 Mon Sep 17 00:00:00 2001 -From: Romain Vimont -Date: Tue, 18 Jan 2022 15:12:26 +0100 -Subject: [PATCH 3/8] avcodec: replace removed FMT_VAAPI_VLD enum value - -Replace AV_PIX_FMT_VAAPI_VLD by AV_PIX_FMT_VAAPI. - -ffmpeg/9f8e57efe4400ca86352277873792792279c3b15 (deprecation) -ffmpeg/ad524cb9eeb298f7a60d923094fbebb1fda7e0e3 (removal) ---- - modules/codec/avcodec/va.c | 2 +- - modules/codec/avcodec/vaapi.c | 4 ++-- - modules/codec/avcodec/video.c | 2 +- - 3 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/modules/codec/avcodec/va.c b/modules/codec/avcodec/va.c -index 05831232d2..beedcc6027 100644 ---- a/modules/codec/avcodec/va.c -+++ b/modules/codec/avcodec/va.c -@@ -37,7 +37,7 @@ vlc_fourcc_t vlc_va_GetChroma(enum PixelFormat hwfmt, enum PixelFormat swfmt) - * fatal, especially not if a software format. */ - switch (hwfmt) - { -- case AV_PIX_FMT_VAAPI_VLD: -+ case AV_PIX_FMT_VAAPI: - switch (swfmt) - { - case AV_PIX_FMT_YUVJ420P: -diff --git a/modules/codec/avcodec/vaapi.c b/modules/codec/avcodec/vaapi.c -index 35e6c47263..3675d2fc79 100644 ---- a/modules/codec/avcodec/vaapi.c -+++ b/modules/codec/avcodec/vaapi.c -@@ -154,7 +154,7 @@ static void Delete(vlc_va_t *va, void **hwctx) - static int Create(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt, - const es_format_t *fmt, picture_sys_t *p_sys) - { -- if (pix_fmt != AV_PIX_FMT_VAAPI_VLD || p_sys == NULL) -+ if (pix_fmt != AV_PIX_FMT_VAAPI || p_sys == NULL) - return VLC_EGENERIC; - - (void) fmt; -@@ -263,7 +263,7 @@ static void DeleteDRM(vlc_va_t *va, void **hwctx) - static int CreateDRM(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt, - const es_format_t *fmt, picture_sys_t *p_sys) - { -- if (pix_fmt != AV_PIX_FMT_VAAPI_VLD || p_sys) -+ if (pix_fmt != AV_PIX_FMT_VAAPI || p_sys) - return VLC_EGENERIC; - - (void) fmt; -diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c -index 21a8a6be50..199af50c6f 100644 ---- a/modules/codec/avcodec/video.c -+++ b/modules/codec/avcodec/video.c -@@ -1613,7 +1613,7 @@ no_reuse: - #endif - AV_PIX_FMT_DXVA2_VLD, - #endif -- AV_PIX_FMT_VAAPI_VLD, -+ AV_PIX_FMT_VAAPI, - #if (LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(52, 4, 0)) - AV_PIX_FMT_VDPAU, - #endif --- -GitLab - - -From abb9e9a21d9a6d4c952101e45a70182a37fe855e Mon Sep 17 00:00:00 2001 -From: Romain Vimont -Date: Tue, 18 Jan 2022 15:16:39 +0100 -Subject: [PATCH 4/8] avcodec: adapt AVCodec API constification - -Refs ffmpeg/626535f6a169e2d821b969e0ea77125ba7482113 ---- - modules/codec/avcodec/encoder.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c -index c10f44c0c2..46573b17c9 100644 ---- a/modules/codec/avcodec/encoder.c -+++ b/modules/codec/avcodec/encoder.c -@@ -93,7 +93,7 @@ struct encoder_sys_t - /* - * libavcodec properties - */ -- AVCodec *p_codec; -+ const AVCodec *p_codec; - AVCodecContext *p_context; - - /* -@@ -234,7 +234,7 @@ static const int DEFAULT_ALIGN = 0; - /***************************************************************************** - * InitVideoEnc: probe the encoder - *****************************************************************************/ --static void probe_video_frame_rate( encoder_t *p_enc, AVCodecContext *p_context, AVCodec *p_codec ) -+static void probe_video_frame_rate( encoder_t *p_enc, AVCodecContext *p_context, const AVCodec *p_codec ) - { - /* if we don't have i_frame_rate_base, we are probing and just checking if we can find codec - * so set fps to requested fps if asked by user or input fps is availabled */ -@@ -296,7 +296,7 @@ int InitVideoEnc( vlc_object_t *p_this ) - encoder_t *p_enc = (encoder_t *)p_this; - encoder_sys_t *p_sys; - AVCodecContext *p_context; -- AVCodec *p_codec = NULL; -+ const AVCodec *p_codec = NULL; - unsigned i_codec_id; - const char *psz_namecodec; - float f_val; --- -GitLab - - -From 83eb99de2bd0a14cfe561106c007bf6e385881c1 Mon Sep 17 00:00:00 2001 -From: Ilkka Ollakka -Date: Fri, 18 Jun 2021 10:08:44 +0300 -Subject: [PATCH 5/8] avcodec: move picture type to use sidedata on encoding - -Sidedata AV_PKT_DATA_QUALITY_STATS has been present since 2015 on -version 56.51.100. Also previous coded_frame->pict_type doesn't seem to -be present anymore in ffmpeg master. - -(cherry picked from commit 8ed4f2a7a2dbc9522c3feebb39b2e4ccc7bf5d24) - -Refs ffmpeg/11bc79089378a5ec00547d0f85bc152afdf30dfa ---- - modules/codec/avcodec/encoder.c | 44 +++++++++++++++++---------------- - 1 file changed, 23 insertions(+), 21 deletions(-) - -diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c -index 46573b17c9..5ea65de787 100644 ---- a/modules/codec/avcodec/encoder.c -+++ b/modules/codec/avcodec/encoder.c -@@ -1101,6 +1101,29 @@ static block_t *vlc_av_packet_Wrap(AVPacket *packet, mtime_t i_length, AVCodecCo - p_block->i_pts = p_block->i_pts * CLOCK_FREQ * context->time_base.num / context->time_base.den; - p_block->i_dts = p_block->i_dts * CLOCK_FREQ * context->time_base.num / context->time_base.den; - -+ uint8_t *av_packet_sidedata = av_packet_get_side_data(packet, AV_PKT_DATA_QUALITY_STATS, NULL); -+ if( av_packet_sidedata ) -+ { -+ switch ( av_packet_sidedata[4] ) -+ { -+ case AV_PICTURE_TYPE_I: -+ case AV_PICTURE_TYPE_SI: -+ p_block->i_flags |= BLOCK_FLAG_TYPE_I; -+ break; -+ case AV_PICTURE_TYPE_P: -+ case AV_PICTURE_TYPE_SP: -+ p_block->i_flags |= BLOCK_FLAG_TYPE_P; -+ break; -+ case AV_PICTURE_TYPE_B: -+ case AV_PICTURE_TYPE_BI: -+ p_block->i_flags |= BLOCK_FLAG_TYPE_B; -+ break; -+ default: -+ p_block->i_flags |= BLOCK_FLAG_TYPE_PB; -+ } -+ -+ } -+ - return p_block; - } - -@@ -1234,27 +1257,6 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict ) - - block_t *p_block = encode_avframe( p_enc, p_sys, frame ); - -- if( p_block ) -- { -- switch ( p_sys->p_context->coded_frame->pict_type ) -- { -- case AV_PICTURE_TYPE_I: -- case AV_PICTURE_TYPE_SI: -- p_block->i_flags |= BLOCK_FLAG_TYPE_I; -- break; -- case AV_PICTURE_TYPE_P: -- case AV_PICTURE_TYPE_SP: -- p_block->i_flags |= BLOCK_FLAG_TYPE_P; -- break; -- case AV_PICTURE_TYPE_B: -- case AV_PICTURE_TYPE_BI: -- p_block->i_flags |= BLOCK_FLAG_TYPE_B; -- break; -- default: -- p_block->i_flags |= BLOCK_FLAG_TYPE_PB; -- } -- } -- - return p_block; - } - --- -GitLab - - -From de270df11646414bc4173e1f890492b6887d98ee Mon Sep 17 00:00:00 2001 -From: Romain Vimont -Date: Tue, 18 Jan 2022 15:43:27 +0100 -Subject: [PATCH 6/8] avformat: adapt AVOutputFormat API constification - -Refs ffmpeg/56450a0ee4fdda160f4039fc2ae33edfd27765c9 ---- - modules/demux/avformat/mux.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/modules/demux/avformat/mux.c b/modules/demux/avformat/mux.c -index 0b00640baf..ff1a5e45ee 100644 ---- a/modules/demux/avformat/mux.c -+++ b/modules/demux/avformat/mux.c -@@ -86,7 +86,7 @@ static int IOWriteTyped(void *opaque, uint8_t *buf, int buf_size, - *****************************************************************************/ - int avformat_OpenMux( vlc_object_t *p_this ) - { -- AVOutputFormat *file_oformat; -+ const AVOutputFormat *file_oformat; - sout_mux_t *p_mux = (sout_mux_t*)p_this; - bool dummy = !strcmp( p_mux->p_access->psz_access, "dummy"); - --- -GitLab - - -From 657cadbbef00ec9c38528c5948331bb2a0448df3 Mon Sep 17 00:00:00 2001 -From: Mehdi Sabwat -Date: Thu, 9 Apr 2020 21:59:56 +0200 -Subject: [PATCH 7/8] avformat: add support for url field in AvFormatContext - -Since Jan 21, 2018 filename field was deprecated in favor -of `url` which now has no length restrictions. - -From doc/APIChanges: -``` -2018-01-28 - ea3672b7d6 - lavf 58.7.100 - avformat.h - Deprecate AVFormatContext filename field which had limited length, use the - new dynamically allocated url field instead. -``` - -The URL field is freed by libavformat in avformat_free_context() in -avformat_CloseMux(). - -Signed-off-by: Alexandre Janniaux -(cherry picked from commit a2ce2e3a8436845378af3b1828f2bb0fa0f4a268) - -Refs ffmpeg/30f7021aa0be2c978aefb73894b643c9bafbf51c ---- - modules/demux/avformat/mux.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/modules/demux/avformat/mux.c b/modules/demux/avformat/mux.c -index ff1a5e45ee..ffff7bee83 100644 ---- a/modules/demux/avformat/mux.c -+++ b/modules/demux/avformat/mux.c -@@ -90,9 +90,12 @@ int avformat_OpenMux( vlc_object_t *p_this ) - sout_mux_t *p_mux = (sout_mux_t*)p_this; - bool dummy = !strcmp( p_mux->p_access->psz_access, "dummy"); - -+#if ( (LIBAVFORMAT_VERSION_MICRO >= 100) \ -+ && (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 7, 100)) ) - if( dummy && strlen(p_mux->p_access->psz_path) - >= sizeof (((AVFormatContext *)NULL)->filename) ) - return VLC_EGENERIC; -+#endif - - msg_Dbg( p_mux, "using %s %s", AVPROVIDER(LIBAVFORMAT), LIBAVFORMAT_IDENT ); - -@@ -127,7 +130,12 @@ int avformat_OpenMux( vlc_object_t *p_this ) - p_sys->oc->oformat = file_oformat; - /* If we use dummy access, let avformat write output */ - if( dummy ) -+#if ( (LIBAVFORMAT_VERSION_MICRO >= 100) \ -+ && (LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(58, 7, 100)) ) -+ p_sys->oc->url = av_strdup(p_mux->p_access->psz_path); -+#else - strcpy( p_sys->oc->filename, p_mux->p_access->psz_path ); -+#endif - - /* Create I/O wrapper */ - p_sys->io_buffer_size = 10 * 1024 * 1024; /* FIXME */ --- -GitLab - - -From b42e6cb9c82a74980c7c062b0ee6e07ae51d32af Mon Sep 17 00:00:00 2001 -From: Ilkka Ollakka -Date: Fri, 18 Jun 2021 10:31:00 +0300 -Subject: [PATCH 8/8] avformat: remove pts hack from demuxing - -pstream->cur_dts is no longer available from libavformat - -(cherry picked from commit c2ba623f0ad425e7743fca0bdc251d5bc9289e77) - -Refs ffmpeg/591b88e6787c4e678237f02a50421d101abd25c2 ---- - modules/demux/avformat/mux.c | 4 ---- - 1 file changed, 4 deletions(-) - -diff --git a/modules/demux/avformat/mux.c b/modules/demux/avformat/mux.c -index ffff7bee83..8dd8c2f7e6 100644 ---- a/modules/demux/avformat/mux.c -+++ b/modules/demux/avformat/mux.c -@@ -379,10 +379,6 @@ static int MuxBlock( sout_mux_t *p_mux, sout_input_t *p_input ) - 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 ) - { - msg_Err( p_mux, "could not write frame (pts: %"PRId64", dts: %"PRId64") " --- -GitLab - diff --git a/sources b/sources index 954b6a8..bdef25b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (vlc-584bf4f.tar.gz) = 1a71b37821c63efe120d71aa54ec5630320c03457b7bdd23bbef7c3cb430fd4a4234c18abad888d65a57e7b099cd130519eaa28de90400b1beaa861249b135d2 +SHA512 (vlc-bfca680.tar.gz) = 92acc32a7de62f4dd367f4e46808cfa49d47fc6f24960ef5a0704824525e54989a9d1634a5f6376a390c1630fbd663ad90d692adc41f20c2d1810aa38a978d85 diff --git a/vlc.spec b/vlc.spec index 436b855..6677906 100644 --- a/vlc.spec +++ b/vlc.spec @@ -1,4 +1,4 @@ -%global commit0 584bf4f6414daf73adba01fd10f7b0aafdc1330d +%global commit0 bfca6804525d6d748d261e1a3cf57a59612102dc %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: 5%{?dist} +Release: 6%{?dist} License: GPLv2+ URL: https://www.videolan.org %if 0%{?commit0:1} @@ -78,10 +78,8 @@ Patch11: 0001-Revert-configure-ignore-too-new-SRT.patch Patch12: 0001-Revert-access-libdvdread-6.1.2-supports-UTF-8-paths-.patch # https://code.videolan.org/videolan/vlc/-/issues/25473#note_256576 Patch13: 0001-Get-addr-by-ref.-from-getConnectionEndpointAddress.patch -Patch14: https://code.videolan.org/videolan/vlc/-/merge_requests/1245.patch # https://code.videolan.org/videolan/vlc/-/merge_requests/889 -Patch15: Remove_legacy_caca.patch -Patch16: https://code.videolan.org/videolan/vlc/-/merge_requests/1244.patch +Patch14: Remove_legacy_caca.patch BuildRequires: desktop-file-utils BuildRequires: libappstream-glib @@ -363,8 +361,6 @@ sed -i -e 's/luac/luac-5.1/g' configure.ac %if 0%{?fedora} > 35 %patch13 -p1 %patch14 -p1 -%patch15 -p1 -%patch16 -p1 %endif %{?_with_bootstrap: @@ -630,6 +626,9 @@ fi || : %changelog +* Fri Feb 04 2022 Leigh Scott - 1:3.0.17-6 +- rebuilt + * Wed Jan 19 2022 Nicolas Chauvet - 1:3.0.17-5 - rebuilt From 98c4ce01d4888f63394b19555440f26f2374a709 Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Tue, 22 Feb 2022 19:28:51 +0100 Subject: [PATCH 23/24] Update to 3.0.17 --- sources | 2 +- vlc.spec | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/sources b/sources index bdef25b..5b9a5e9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (vlc-bfca680.tar.gz) = 92acc32a7de62f4dd367f4e46808cfa49d47fc6f24960ef5a0704824525e54989a9d1634a5f6376a390c1630fbd663ad90d692adc41f20c2d1810aa38a978d85 +SHA512 (vlc-758b718.tar.gz) = 02dc1f6a9516e7bbb2ed0dd04b57a0e944435847bcde32770370a24563234134f3b08755769a98437d33ebd32a517c32324fd6635173c5793442bd36f100e8c7 diff --git a/vlc.spec b/vlc.spec index 6677906..f20e41e 100644 --- a/vlc.spec +++ b/vlc.spec @@ -1,4 +1,4 @@ -%global commit0 bfca6804525d6d748d261e1a3cf57a59612102dc +%global commit0 758b718347094af7e7e35ec18359d32f8928766e %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: 6%{?dist} +Release: 7%{?dist} License: GPLv2+ URL: https://www.videolan.org %if 0%{?commit0:1} @@ -71,10 +71,6 @@ Patch7: Switch-to-Fedora-lua-5.1.patch # Backport for 3.0 notifyd without gtk3 Patch9: notify-don-t-depend-on-any-GTK-version.patch -# Fix build issue with recent SRT library -# Based on https://git.videolan.org/?p=vlc.git;a=commit;h=6e8d77431127c482196115a6eeb769daf56347b3 -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 # https://code.videolan.org/videolan/vlc/-/issues/25473#note_256576 Patch13: 0001-Get-addr-by-ref.-from-getConnectionEndpointAddress.patch @@ -353,13 +349,11 @@ sed -i -e 's/luac/luac-5.1/g' configure.ac %endif %patch9 -p1 -%patch10 -p1 -%patch11 -p1 %if 0%{?rhel} >= 7 %patch12 -p1 %endif %if 0%{?fedora} > 35 -%patch13 -p1 +#patch13 -p1 %patch14 -p1 %endif @@ -626,6 +620,9 @@ fi || : %changelog +* Tue Feb 22 2022 Nicolas Chauvet +- Update to 3.0.17 + * Fri Feb 04 2022 Leigh Scott - 1:3.0.17-6 - rebuilt From 88ad0230e905785046121e83893f4bc1f78e9b73 Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Tue, 22 Feb 2022 22:15:52 +0100 Subject: [PATCH 24/24] Fixup --- vlc.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vlc.spec b/vlc.spec index f20e41e..350e060 100644 --- a/vlc.spec +++ b/vlc.spec @@ -352,8 +352,8 @@ sed -i -e 's/luac/luac-5.1/g' configure.ac %if 0%{?rhel} >= 7 %patch12 -p1 %endif +%patch13 -p1 %if 0%{?fedora} > 35 -#patch13 -p1 %patch14 -p1 %endif