From a782ba3bb246248d51810dcc96b42bc73c223533 Mon Sep 17 00:00:00 2001 From: phunkyfish Date: Thu, 8 Feb 2024 09:57:38 +0000 Subject: [PATCH 1/2] Patch to disable hardware acceleration for interlaced video on TvOS --- ...os-disable-hw-accel-interlaced-video.patch | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 depends/common/ffmpeg/0004-ffmpeg-tvos-disable-hw-accel-interlaced-video.patch diff --git a/depends/common/ffmpeg/0004-ffmpeg-tvos-disable-hw-accel-interlaced-video.patch b/depends/common/ffmpeg/0004-ffmpeg-tvos-disable-hw-accel-interlaced-video.patch new file mode 100644 index 00000000..72334d9e --- /dev/null +++ b/depends/common/ffmpeg/0004-ffmpeg-tvos-disable-hw-accel-interlaced-video.patch @@ -0,0 +1,34 @@ +diff -ur a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c +--- a/libavcodec/videotoolbox.c ++++ b/libavcodec/videotoolbox.c +@@ -825,11 +825,18 @@ + if (data) + CFDictionarySetValue(avc_info, CFSTR("esds"), data); + break; +- case kCMVideoCodecType_H264 : ++ case kCMVideoCodecType_H264 : { ++ H264Context *h = avctx->priv_data; ++ if (TARGET_OS_IPHONE && h->ps.sps->frame_mbs_only_flag == 0) { ++ av_log(avctx, AV_LOG_ERROR, "VideoToolbox cannot decode interlaced fields on iOS\n"); ++ CFRelease(avc_info); ++ goto fail; ++ } + data = ff_videotoolbox_avcc_extradata_create(avctx); + if (data) + CFDictionarySetValue(avc_info, CFSTR("avcC"), data); + break; ++ } + case kCMVideoCodecType_HEVC : + data = ff_videotoolbox_hvcc_extradata_create(avctx); + if (data) +@@ -855,6 +862,10 @@ + + CFRelease(avc_info); + return config_info; ++ ++fail: ++ CFRelease(config_info); ++ return NULL; + } + + static int videotoolbox_start(AVCodecContext *avctx) From b4b0300e11b9a12f75bd06d19837ba12948d0f8d Mon Sep 17 00:00:00 2001 From: phunkyfish Date: Thu, 8 Feb 2024 10:18:10 +0000 Subject: [PATCH 2/2] changelog and version v21.3.3 --- inputstream.ffmpegdirect/addon.xml.in | 2 +- inputstream.ffmpegdirect/changelog.txt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/inputstream.ffmpegdirect/addon.xml.in b/inputstream.ffmpegdirect/addon.xml.in index aede7fa1..cad51bb6 100644 --- a/inputstream.ffmpegdirect/addon.xml.in +++ b/inputstream.ffmpegdirect/addon.xml.in @@ -1,7 +1,7 @@ @ADDON_DEPENDS@ diff --git a/inputstream.ffmpegdirect/changelog.txt b/inputstream.ffmpegdirect/changelog.txt index f78ab1c2..7f8fd199 100644 --- a/inputstream.ffmpegdirect/changelog.txt +++ b/inputstream.ffmpegdirect/changelog.txt @@ -1,3 +1,7 @@ +v21.3.3 +- Patch to disable hardware acceleration for interlaced video on TvOS +- Patch to check for nullptr on surface for dxva2 on window + v21.3.2 - Fix deprecations for m_pFormatContext's codecpar->channels for streams ffmpeg6 and a single use of vsprintf