contrib: ffmpeg update to 5.1.2 release

Remove 3 patches that were upstreamed.
Remove `--disable-avresample` since the library is gone now.
This commit is contained in:
Thomas Guillem 2023-03-02 15:29:15 +01:00 committed by Jean-Baptiste Kempf
parent d7b792f7da
commit c45fd72c96
5 changed files with 3 additions and 150 deletions

View File

@ -1,74 +0,0 @@
From e337ba0bce7595366e417b4eed8c2c321726bd87 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Thu, 2 Sep 2021 17:34:35 +0200
Subject: [PATCH] avcodec/vp9: Do not destroy uninitialized mutexes/conditions
Also do not destroy and reinitialize mutexes and conditions when
certain input parameters change. Given that the decoder did not
create these variables at all during init, uninitialized mutexes
and conditions are destroyed before the very first initialization.
This is undefined behaviour and certain threading implementations
like pthreadGC2 crash when it is attempted.
Fix this by initializing these objects once during init and freeing
them in close.
Reported-by: Steve Lhomme <robux4@ycbcr.xyz>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vp9.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 4659f94ee8..1bdaba0aef 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -43,8 +43,6 @@ static void vp9_free_entries(AVCodecContext *avctx) {
VP9Context *s = avctx->priv_data;
if (avctx->active_thread_type & FF_THREAD_SLICE) {
- pthread_mutex_destroy(&s->progress_mutex);
- pthread_cond_destroy(&s->progress_cond);
av_freep(&s->entries);
}
}
@@ -66,9 +64,6 @@ static int vp9_alloc_entries(AVCodecContext *avctx, int n) {
for (i = 0; i < n; i++)
atomic_init(&s->entries[i], 0);
-
- pthread_mutex_init(&s->progress_mutex, NULL);
- pthread_cond_init(&s->progress_cond, NULL);
}
return 0;
}
@@ -1252,6 +1247,12 @@ static av_cold int vp9_decode_free(AVCodecContext *avctx)
free_buffers(s);
vp9_free_entries(avctx);
+#if HAVE_THREADS
+ if (avctx->active_thread_type & FF_THREAD_SLICE) {
+ pthread_mutex_destroy(&s->progress_mutex);
+ pthread_cond_destroy(&s->progress_cond);
+ }
+#endif
av_freep(&s->td);
return 0;
}
@@ -1800,6 +1801,13 @@ static int init_frames(AVCodecContext *avctx)
VP9Context *s = avctx->priv_data;
int i;
+#if HAVE_THREADS
+ if (avctx->active_thread_type & FF_THREAD_SLICE) {
+ pthread_mutex_init(&s->progress_mutex, NULL);
+ pthread_cond_init(&s->progress_cond, NULL);
+ }
+#endif
+
for (i = 0; i < 3; i++) {
s->s.frames[i].tf.f = av_frame_alloc();
if (!s->s.frames[i].tf.f) {
--
2.27.0.windows.1

View File

@ -1,34 +0,0 @@
From b2e89bd9c548d899ec2fecfc1aa550e9ddfe9777 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Wed, 23 Mar 2022 14:52:31 +0100
Subject: [PATCH] dxva2_hevc: don't use frames as reference if they are not
marked as such
Similar to how a frame is considered for referencing for the RefPicList array.
This will do the same for RefPicSetStCurrBefore, RefPicSetStCurrAfter and
RefPicSetLtCurr.
Fixes playback of http://www.gbbsoft.pl/!download/!/Film1.mp4
Ref. VLC issue https://code.videolan.org/videolan/vlc/-/issues/26738
Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
---
libavcodec/dxva2_hevc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/dxva2_hevc.c b/libavcodec/dxva2_hevc.c
index 98b3e74bd7..28c0b26733 100644
--- a/libavcodec/dxva2_hevc.c
+++ b/libavcodec/dxva2_hevc.c
@@ -249,7 +249,7 @@ static void fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext *
const HEVCFrame *frame = NULL; \
while (!frame && j < rpl->nb_refs) \
frame = rpl->ref[j++]; \
- if (frame) \
+ if (frame && frame->flags & (HEVC_FRAME_FLAG_LONG_REF | HEVC_FRAME_FLAG_SHORT_REF)) \
pp->ref_list[i] = get_refpic_index(pp, ff_dxva2_get_surface_index(avctx, ctx, frame->frame)); \
else \
pp->ref_list[i] = 0xff; \
--
2.27.0.windows.1

View File

@ -1,35 +0,0 @@
From 378ad2f8fd7c5b5d9d1b3170282ce6b8a289ba07 Mon Sep 17 00:00:00 2001
From: Zhao Zhili <zhilizhao@tencent.com>
Date: Mon, 13 Sep 2021 15:24:09 +0800
Subject: [PATCH] lavc/aarch64: fix relocation out of range error
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Use a temporary label instead of global function symbol for b.gt.
Signed-off-by: Martin Storsjö <martin@martin.st>
---
libavcodec/aarch64/videodsp.S | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavcodec/aarch64/videodsp.S b/libavcodec/aarch64/videodsp.S
index 24067cc2af..fe2da0658e 100644
--- a/libavcodec/aarch64/videodsp.S
+++ b/libavcodec/aarch64/videodsp.S
@@ -19,10 +19,11 @@
#include "libavutil/aarch64/asm.S"
function ff_prefetch_aarch64, export=1
+1:
subs w2, w2, #2
prfm pldl1strm, [x0]
prfm pldl1strm, [x0, x1]
add x0, x0, x1, lsl #1
- b.gt X(ff_prefetch_aarch64)
+ b.gt 1b
ret
endfunc
--
2.35.1

View File

@ -1 +1 @@
0b232b66555237ed1a061807f88dbc5e6cd156e604c5d611bb6ac0c32b9006414cc4f30d632b482d9cb95f526df98b36efa3af9c863c52e7b7aa1a183545d915 ffmpeg-4.4.3.tar.xz
04d9ae2a0e9238c469941d2bb9929d59b58f4be3830846cf91b02a440da17803a04b147a4e0168c9ffd6f62ca82187508bc7b53255de9787a97168278e903b9b ffmpeg-5.1.2.tar.xz

View File

@ -1,8 +1,8 @@
# FFmpeg
FFMPEG_HASH=ec47a3b95f88fc3f820b900038ac439e4eb3fede
FFMPEG_MAJVERSION := 4.4
FFMPEG_REVISION := 3
FFMPEG_MAJVERSION := 5.1
FFMPEG_REVISION := 2
FFMPEG_VERSION := $(FFMPEG_MAJVERSION).$(FFMPEG_REVISION)
FFMPEG_BRANCH=release/$(FFMPEG_MAJVERSION)
FFMPEG_URL := https://ffmpeg.org/releases/ffmpeg-$(FFMPEG_VERSION).tar.xz
@ -29,7 +29,6 @@ FFMPEGCONF = \
--disable-bsfs \
--disable-bzlib \
--disable-libvpx \
--disable-avresample \
--enable-bsf=vp9_superframe \
--disable-swresample \
--disable-iconv \
@ -226,10 +225,7 @@ ffmpeg: ffmpeg-$(FFMPEG_VERSION).tar.xz .sum-ffmpeg
$(APPLY) $(SRC)/ffmpeg/0001-avcodec-mpeg12dec-don-t-call-hw-end_frame-when-start.patch
$(APPLY) $(SRC)/ffmpeg/0002-avcodec-mpeg12dec-don-t-end-a-slice-without-first_sl.patch
$(APPLY) $(SRC)/ffmpeg/0001-fix-mf_utils-compilation-with-mingw64.patch
$(APPLY) $(SRC)/ffmpeg/0001-avcodec-vp9-Do-not-destroy-uninitialized-mutexes-con.patch
$(APPLY) $(SRC)/ffmpeg/0001-ffmpeg-add-target_os-support-for-emscripten.patch
$(APPLY) $(SRC)/ffmpeg/0001-dxva2_hevc-don-t-use-frames-as-reference-if-they-are.patch
$(APPLY) $(SRC)/ffmpeg/0001-lavc-aarch64-fix-relocation-out-of-range-error.patch
$(MOVE)
.ffmpeg: ffmpeg