From ae73c5e1c8cea6d46399fa5dc945cd4d71a3c18c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 5 Sep 2021 22:48:14 +0200 Subject: [PATCH] Revert "- ffmpeg: bump version to 4.4" This reverts commit 542554e4e78e06bb73d6743dfc01df8faea63701. --- make/target-ffmpeg.mk | 2 +- ...-assembly-with-full-path-from-sourc.patch} | 0 ...-x86-yuv2rgb-Fix-build-without-SSSE3.patch | 43 ------ ...264-skip-decode-if-pic-has-no-slices.patch | 36 ----- .../0003-libavutil-Fix-mips-build.patch | 72 ---------- ...igure-add-extralibs-to-extralibs_xxx.patch | 47 ------- ...fix_mpegts.patch => 4_02_fix_mpegts.patch} | 2 +- ...allow_to_choose_rtmp_impl_at_runtime.patch | 126 ++++++++++++++++++ ...i.patch => 4_04_hls_replace_key_uri.patch} | 32 ++--- ...mize_aac.patch => 4_06_optimize_aac.patch} | 8 +- ....patch => 4_07_increase_buffer_size.patch} | 2 +- ...patch => 4_08_recheck_discard_flags.patch} | 2 +- ...> 4_09_ffmpeg_fix_edit_list_parsing.patch} | 2 +- ...{ffmpeg-4.4-rtsp.patch => 4_11_rtsp.patch} | 9 +- ...fmpeg-4.4-dxva2.patch => 4_12_dxva2.patch} | 22 ++- .../patches/4_mips64_cpu_detection.patch | 30 +++++ .../ffmpeg/patches/ffmpeg-4.4-INT64-fix.patch | 17 --- .../ffmpeg-4.4-mips64_cpu_detection.patch | 32 ----- 18 files changed, 204 insertions(+), 280 deletions(-) rename package/ffmpeg/patches/{ffmpeg-4.4-libavutil-include-assembly-with-full-path-from-sourc.patch => 0001-libavutil-include-assembly-with-full-path-from-sourc.patch} (100%) delete mode 100644 package/ffmpeg/patches/0001-swscale-x86-yuv2rgb-Fix-build-without-SSSE3.patch delete mode 100644 package/ffmpeg/patches/0002-avcodec-vaapi_h264-skip-decode-if-pic-has-no-slices.patch delete mode 100644 package/ffmpeg/patches/0003-libavutil-Fix-mips-build.patch delete mode 100644 package/ffmpeg/patches/0004-configure-add-extralibs-to-extralibs_xxx.patch rename package/ffmpeg/patches/{ffmpeg-4.4-fix_mpegts.patch => 4_02_fix_mpegts.patch} (92%) create mode 100644 package/ffmpeg/patches/4_03_allow_to_choose_rtmp_impl_at_runtime.patch rename package/ffmpeg/patches/{ffmpeg-4.4-hls_replace_key_uri.patch => 4_04_hls_replace_key_uri.patch} (69%) rename package/ffmpeg/patches/{ffmpeg-4.4-optimize_aac.patch => 4_06_optimize_aac.patch} (95%) rename package/ffmpeg/patches/{ffmpeg-4.4-increase_buffer_size.patch => 4_07_increase_buffer_size.patch} (97%) rename package/ffmpeg/patches/{ffmpeg-4.4-recheck_discard_flags.patch => 4_08_recheck_discard_flags.patch} (94%) rename package/ffmpeg/patches/{ffmpeg-4.4-fix_edit_list_parsing.patch => 4_09_ffmpeg_fix_edit_list_parsing.patch} (96%) rename package/ffmpeg/patches/{ffmpeg-4.4-rtsp.patch => 4_11_rtsp.patch} (89%) rename package/ffmpeg/patches/{ffmpeg-4.4-dxva2.patch => 4_12_dxva2.patch} (87%) create mode 100644 package/ffmpeg/patches/4_mips64_cpu_detection.patch delete mode 100644 package/ffmpeg/patches/ffmpeg-4.4-INT64-fix.patch delete mode 100644 package/ffmpeg/patches/ffmpeg-4.4-mips64_cpu_detection.patch diff --git a/make/target-ffmpeg.mk b/make/target-ffmpeg.mk index f01abd7d..253b13f1 100644 --- a/make/target-ffmpeg.mk +++ b/make/target-ffmpeg.mk @@ -3,7 +3,7 @@ # # ----------------------------------------------------------------------------- -FFMPEG_VERSION = 4.4 +FFMPEG_VERSION = 4.3.2 FFMPEG_DIR = ffmpeg-$(FFMPEG_VERSION) FFMPEG_SOURCE = ffmpeg-$(FFMPEG_VERSION).tar.xz FFMPEG_SITE = http://www.ffmpeg.org/releases diff --git a/package/ffmpeg/patches/ffmpeg-4.4-libavutil-include-assembly-with-full-path-from-sourc.patch b/package/ffmpeg/patches/0001-libavutil-include-assembly-with-full-path-from-sourc.patch similarity index 100% rename from package/ffmpeg/patches/ffmpeg-4.4-libavutil-include-assembly-with-full-path-from-sourc.patch rename to package/ffmpeg/patches/0001-libavutil-include-assembly-with-full-path-from-sourc.patch diff --git a/package/ffmpeg/patches/0001-swscale-x86-yuv2rgb-Fix-build-without-SSSE3.patch b/package/ffmpeg/patches/0001-swscale-x86-yuv2rgb-Fix-build-without-SSSE3.patch deleted file mode 100644 index 951ce418..00000000 --- a/package/ffmpeg/patches/0001-swscale-x86-yuv2rgb-Fix-build-without-SSSE3.patch +++ /dev/null @@ -1,43 +0,0 @@ -From bf8eae2d30a205bb76ac625e04c0351106981b9e Mon Sep 17 00:00:00 2001 -From: Parker Ernest <@> -Date: Sun, 23 Feb 2020 13:22:42 +0100 -Subject: [PATCH] swscale/x86/yuv2rgb: Fix build without SSSE3 - -commit fc6a5883d6af8cae0e96af84dda0ad74b360a084 breaks build on -x86_64 CPUs which do not have SSSE3, e.g. AMD Phenom-II - -Signed-off-by: Michael Niedermayer -[bernd.kuhls@t-online.de: - - retrieved from upstream patchwork: - https://patchwork.ffmpeg.org/project/ffmpeg/patch/20200223122256.23402-1-michael@niedermayer.cc/ -] -Signed-off-by: Bernd Kuhls -[yann.morin.1998@free.fr: fix reference top patchwork and SoB order] -Signed-off-by: Yann E. MORIN ---- - libswscale/x86/yuv2rgb.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/libswscale/x86/yuv2rgb.c b/libswscale/x86/yuv2rgb.c -index c12e88cbb5..4791e5b93a 100644 ---- a/libswscale/x86/yuv2rgb.c -+++ b/libswscale/x86/yuv2rgb.c -@@ -83,6 +83,7 @@ av_cold SwsFunc ff_yuv2rgb_init_x86(SwsContext *c) - #if HAVE_X86ASM - int cpu_flags = av_get_cpu_flags(); - -+#if HAVE_SSSE3 - if (EXTERNAL_SSSE3(cpu_flags)) { - switch (c->dstFormat) { - case AV_PIX_FMT_RGB32: -@@ -111,6 +112,7 @@ av_cold SwsFunc ff_yuv2rgb_init_x86(SwsContext *c) - return yuv420_rgb15_ssse3; - } - } -+#endif - - if (EXTERNAL_MMXEXT(cpu_flags)) { - switch (c->dstFormat) { --- -2.26.2 - diff --git a/package/ffmpeg/patches/0002-avcodec-vaapi_h264-skip-decode-if-pic-has-no-slices.patch b/package/ffmpeg/patches/0002-avcodec-vaapi_h264-skip-decode-if-pic-has-no-slices.patch deleted file mode 100644 index 2892df9d..00000000 --- a/package/ffmpeg/patches/0002-avcodec-vaapi_h264-skip-decode-if-pic-has-no-slices.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 2c6b3f357331e203ad87214984661c40704aceb7 Mon Sep 17 00:00:00 2001 -From: Rainer Hochecker -Date: Sat, 26 Jan 2019 19:48:35 +0100 -Subject: [PATCH] avcodec/vaapi_h264: skip decode if pic has no slices - -This fixes / workarounds https://bugs.freedesktop.org/show_bug.cgi?id=105368. -It was hit frequently when watching h264 channels received via DVB-X. -Corresponding kodi bug: https://github.com/xbmc/xbmc/issues/15704 - -Downloaded from Kodi ffmpeg repo: -https://github.com/xbmc/FFmpeg/commit/2c6b3f357331e203ad87214984661c40704aceb7 - -Patch was sent upstream: -http://ffmpeg.org/pipermail/ffmpeg-devel/2019-March/240863.html - -Signed-off-by: Bernd Kuhls ---- - libavcodec/vaapi_h264.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c -index dd2a6571604..e521a05c4ff 100644 ---- a/libavcodec/vaapi_h264.c -+++ b/libavcodec/vaapi_h264.c -@@ -314,6 +314,11 @@ static int vaapi_h264_end_frame(AVCodecContext *avctx) - H264SliceContext *sl = &h->slice_ctx[0]; - int ret; - -+ if (pic->nb_slices == 0) { -+ ret = AVERROR_INVALIDDATA; -+ goto finish; -+ } -+ - ret = ff_vaapi_decode_issue(avctx, pic); - if (ret < 0) - goto finish; diff --git a/package/ffmpeg/patches/0003-libavutil-Fix-mips-build.patch b/package/ffmpeg/patches/0003-libavutil-Fix-mips-build.patch deleted file mode 100644 index 8b81e669..00000000 --- a/package/ffmpeg/patches/0003-libavutil-Fix-mips-build.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 6e8daf0d502a2a822f1f08f42368d7d676dc1a9e Mon Sep 17 00:00:00 2001 -From: Bernd Kuhls -Date: Sun, 6 Jun 2021 08:54:53 +0200 -Subject: [PATCH] libavutil: Fix mips build - -Check for sys/auxv.h because not all toolchains contain this header. - -Fixes https://trac.ffmpeg.org/ticket/9138 - -Patch sent upstream: -http://ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281272.html - -Signed-off-by: Bernd Kuhls ---- - configure | 2 ++ - libavutil/mips/cpu.c | 6 +++--- - 2 files changed, 5 insertions(+), 3 deletions(-) - -diff --git a/configure b/configure -index 6bfd98b384..773a7d516c 100755 ---- a/configure -+++ b/configure -@@ -2161,6 +2161,7 @@ HEADERS_LIST=" - opencv2_core_core_c_h - OpenGL_gl3_h - poll_h -+ sys_auxv_h - sys_param_h - sys_resource_h - sys_select_h -@@ -6218,6 +6219,7 @@ check_func_headers VideoToolbox/VTCompressionSession.h VTCompressionSessionPrepa - check_headers windows.h - check_headers X11/extensions/XvMClib.h - check_headers asm/types.h -+check_headers sys/auxv.h - - # it seems there are versions of clang in some distros that try to use the - # gcc headers, which explodes for stdatomic -diff --git a/libavutil/mips/cpu.c b/libavutil/mips/cpu.c -index 59619d54de..19196de50b 100644 ---- a/libavutil/mips/cpu.c -+++ b/libavutil/mips/cpu.c -@@ -19,7 +19,7 @@ - #include "libavutil/cpu.h" - #include "libavutil/cpu_internal.h" - #include "config.h" --#if defined __linux__ || defined __ANDROID__ -+#if (defined __linux__ || defined __ANDROID__) && HAVE_SYS_AUXV_H - #include - #include - #include -@@ -28,7 +28,7 @@ - #include "libavutil/avstring.h" - #endif - --#if defined __linux__ || defined __ANDROID__ -+#if (defined __linux__ || defined __ANDROID__) && HAVE_SYS_AUXV_H - - #define HWCAP_LOONGSON_CPUCFG (1 << 14) - -@@ -105,7 +105,7 @@ static int cpu_flags_cpuinfo(void) - - int ff_get_cpu_flags_mips(void) - { --#if defined __linux__ || defined __ANDROID__ -+#if (defined __linux__ || defined __ANDROID__) && HAVE_SYS_AUXV_H - if (cpucfg_available()) - return cpu_flags_cpucfg(); - else --- -2.29.2 - diff --git a/package/ffmpeg/patches/0004-configure-add-extralibs-to-extralibs_xxx.patch b/package/ffmpeg/patches/0004-configure-add-extralibs-to-extralibs_xxx.patch deleted file mode 100644 index dbc19c1c..00000000 --- a/package/ffmpeg/patches/0004-configure-add-extralibs-to-extralibs_xxx.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 0c288853630b7b4e004774c39945d4a804afcfa8 Mon Sep 17 00:00:00 2001 -From: Fabrice Fontaine -Date: Fri, 6 Aug 2021 09:17:20 +0200 -Subject: [PATCH] configure: add extralibs to extralibs_xxx - -Add extralibs to extralibs_xxx (e.g. extralibs_avformat) to allow -applications such as motion to retrieve ffmpeg dependencies such as --latomic through pkg-config - -Signed-off-by: Fabrice Fontaine -[Upstream status: not upstreamable] ---- - configure | 18 +++++++++--------- - 1 file changed, 9 insertions(+), 9 deletions(-) - -diff --git a/configure b/configure -index 0bb3a7cf2b..3bda99e415 100755 ---- a/configure -+++ b/configure -@@ -7602,15 +7602,15 @@ rpath=$(enabled rpath && echo "-Wl,-rpath,\${libdir}") - source_path=${source_path} - LIBPREF=${LIBPREF} - LIBSUF=${LIBSUF} --extralibs_avutil="$avutil_extralibs" --extralibs_avcodec="$avcodec_extralibs" --extralibs_avformat="$avformat_extralibs" --extralibs_avdevice="$avdevice_extralibs" --extralibs_avfilter="$avfilter_extralibs" --extralibs_avresample="$avresample_extralibs" --extralibs_postproc="$postproc_extralibs" --extralibs_swscale="$swscale_extralibs" --extralibs_swresample="$swresample_extralibs" -+extralibs_avutil="$avutil_extralibs $extralibs" -+extralibs_avcodec="$avcodec_extralibs $extralibs" -+extralibs_avformat="$avformat_extralibs $extralibs" -+extralibs_avdevice="$avdevice_extralibs $extralibs" -+extralibs_avfilter="$avfilter_extralibs $extralibs" -+extralibs_avresample="$avresample_extralibs $extralibs" -+extralibs_postproc="$postproc_extralibs $extralibs" -+extralibs_swscale="$swscale_extralibs $extralibs" -+extralibs_swresample="$swresample_extralibs $extralibs" - EOF - - for lib in $LIBRARY_LIST; do --- -2.30.2 - diff --git a/package/ffmpeg/patches/ffmpeg-4.4-fix_mpegts.patch b/package/ffmpeg/patches/4_02_fix_mpegts.patch similarity index 92% rename from package/ffmpeg/patches/ffmpeg-4.4-fix_mpegts.patch rename to package/ffmpeg/patches/4_02_fix_mpegts.patch index 5867d570..1bc25470 100644 --- a/package/ffmpeg/patches/ffmpeg-4.4-fix_mpegts.patch +++ b/package/ffmpeg/patches/4_02_fix_mpegts.patch @@ -1,6 +1,6 @@ --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c -@@ -1018,10 +1018,12 @@ +@@ -1015,10 +1015,12 @@ pes->buffer = NULL; reset_pes_packet_state(pes); diff --git a/package/ffmpeg/patches/4_03_allow_to_choose_rtmp_impl_at_runtime.patch b/package/ffmpeg/patches/4_03_allow_to_choose_rtmp_impl_at_runtime.patch new file mode 100644 index 00000000..38476ddd --- /dev/null +++ b/package/ffmpeg/patches/4_03_allow_to_choose_rtmp_impl_at_runtime.patch @@ -0,0 +1,126 @@ +--- a/configure ++++ b/configure +@@ -3411,10 +3411,8 @@ + # protocols + async_protocol_deps="threads" + bluray_protocol_deps="libbluray" +-ffrtmpcrypt_protocol_conflict="librtmp_protocol" + ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl mbedtls" + ffrtmpcrypt_protocol_select="tcp_protocol" +-ffrtmphttp_protocol_conflict="librtmp_protocol" + ffrtmphttp_protocol_select="http_protocol" + ftp_protocol_select="tcp_protocol" + gopher_protocol_select="network" +@@ -3427,20 +3425,18 @@ + icecast_protocol_select="http_protocol" + mmsh_protocol_select="http_protocol" + mmst_protocol_select="network" +-rtmp_protocol_conflict="librtmp_protocol" +-rtmp_protocol_select="tcp_protocol" +-rtmp_protocol_suggest="zlib" +-rtmpe_protocol_select="ffrtmpcrypt_protocol" +-rtmpe_protocol_suggest="zlib" +-rtmps_protocol_conflict="librtmp_protocol" +-rtmps_protocol_select="tls_protocol" +-rtmps_protocol_suggest="zlib" +-rtmpt_protocol_select="ffrtmphttp_protocol" +-rtmpt_protocol_suggest="zlib" +-rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol" +-rtmpte_protocol_suggest="zlib" +-rtmpts_protocol_select="ffrtmphttp_protocol https_protocol" +-rtmpts_protocol_suggest="zlib" ++ffrtmp_protocol_select="tcp_protocol" ++ffrtmp_protocol_suggest="zlib" ++ffrtmpe_protocol_select="ffrtmpcrypt_protocol" ++ffrtmpe_protocol_suggest="zlib" ++ffrtmps_protocol_select="tls_protocol" ++ffrtmps_protocol_suggest="zlib" ++ffrtmpt_protocol_select="ffrtmphttp_protocol" ++ffrtmpt_protocol_suggest="zlib" ++ffrtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol" ++ffrtmpte_protocol_suggest="zlib" ++ffrtmpts_protocol_select="ffrtmphttp_protocol https_protocol" ++ffrtmpts_protocol_suggest="zlib" + rtp_protocol_select="udp_protocol" + schannel_conflict="openssl gnutls libtls mbedtls" + sctp_protocol_deps="struct_sctp_event_subscribe struct_msghdr_msg_flags" +--- a/libavformat/Makefile ++++ b/libavformat/Makefile +@@ -609,12 +609,12 @@ + OBJS-$(CONFIG_MMST_PROTOCOL) += mmst.o mms.o asf.o + OBJS-$(CONFIG_PIPE_PROTOCOL) += file.o + OBJS-$(CONFIG_PROMPEG_PROTOCOL) += prompeg.o +-OBJS-$(CONFIG_RTMP_PROTOCOL) += rtmpproto.o rtmpdigest.o rtmppkt.o +-OBJS-$(CONFIG_RTMPE_PROTOCOL) += rtmpproto.o rtmpdigest.o rtmppkt.o +-OBJS-$(CONFIG_RTMPS_PROTOCOL) += rtmpproto.o rtmpdigest.o rtmppkt.o +-OBJS-$(CONFIG_RTMPT_PROTOCOL) += rtmpproto.o rtmpdigest.o rtmppkt.o +-OBJS-$(CONFIG_RTMPTE_PROTOCOL) += rtmpproto.o rtmpdigest.o rtmppkt.o +-OBJS-$(CONFIG_RTMPTS_PROTOCOL) += rtmpproto.o rtmpdigest.o rtmppkt.o ++OBJS-$(CONFIG_FFRTMP_PROTOCOL) += rtmpproto.o rtmpdigest.o rtmppkt.o ++OBJS-$(CONFIG_FFRTMPE_PROTOCOL) += rtmpproto.o rtmpdigest.o rtmppkt.o ++OBJS-$(CONFIG_FFRTMPS_PROTOCOL) += rtmpproto.o rtmpdigest.o rtmppkt.o ++OBJS-$(CONFIG_FFRTMPT_PROTOCOL) += rtmpproto.o rtmpdigest.o rtmppkt.o ++OBJS-$(CONFIG_FFRTMPTE_PROTOCOL) += rtmpproto.o rtmpdigest.o rtmppkt.o ++OBJS-$(CONFIG_FFRTMPTS_PROTOCOL) += rtmpproto.o rtmpdigest.o rtmppkt.o + OBJS-$(CONFIG_RTP_PROTOCOL) += rtpproto.o ip.o + OBJS-$(CONFIG_SCTP_PROTOCOL) += sctp.o + OBJS-$(CONFIG_SRTP_PROTOCOL) += srtpproto.o srtp.o +--- a/libavformat/protocols.c ++++ b/libavformat/protocols.c +@@ -44,12 +44,12 @@ + extern const URLProtocol ff_md5_protocol; + extern const URLProtocol ff_pipe_protocol; + extern const URLProtocol ff_prompeg_protocol; +-extern const URLProtocol ff_rtmp_protocol; +-extern const URLProtocol ff_rtmpe_protocol; +-extern const URLProtocol ff_rtmps_protocol; +-extern const URLProtocol ff_rtmpt_protocol; +-extern const URLProtocol ff_rtmpte_protocol; +-extern const URLProtocol ff_rtmpts_protocol; ++extern const URLProtocol ff_ffrtmp_protocol; ++extern const URLProtocol ff_ffrtmpe_protocol; ++extern const URLProtocol ff_ffrtmps_protocol; ++extern const URLProtocol ff_ffrtmpt_protocol; ++extern const URLProtocol ff_ffrtmpte_protocol; ++extern const URLProtocol ff_ffrtmpts_protocol; + extern const URLProtocol ff_rtp_protocol; + extern const URLProtocol ff_sctp_protocol; + extern const URLProtocol ff_srtp_protocol; +--- a/libavformat/rtmpproto.c ++++ b/libavformat/rtmpproto.c +@@ -2591,7 +2591,7 @@ + static int rtmp_open(URLContext *s, const char *uri, int flags, AVDictionary **opts) + { + RTMPContext *rt = s->priv_data; +- char proto[8], hostname[256], path[1024], auth[100], *fname; ++ char *proto, tmpProto[10], hostname[256], path[1024], auth[100], *fname; + char *old_app, *qmark, *n, fname_buffer[1024]; + uint8_t buf[2048]; + int port; +@@ -2602,7 +2602,9 @@ + + rt->is_input = !(flags & AVIO_FLAG_WRITE); + +- av_url_split(proto, sizeof(proto), auth, sizeof(auth), ++ memset(tmpProto, 0, sizeof(tmpProto)); ++ proto = &tmpProto[2]; ++ av_url_split(tmpProto, sizeof(tmpProto), auth, sizeof(auth), + hostname, sizeof(hostname), &port, + path, sizeof(path), s->filename); + +@@ -3141,9 +3143,9 @@ + }; + + +-RTMP_PROTOCOL(rtmp) +-RTMP_PROTOCOL(rtmpe) +-RTMP_PROTOCOL(rtmps) +-RTMP_PROTOCOL(rtmpt) +-RTMP_PROTOCOL(rtmpte) +-RTMP_PROTOCOL(rtmpts) ++RTMP_PROTOCOL(ffrtmp) ++RTMP_PROTOCOL(ffrtmpe) ++RTMP_PROTOCOL(ffrtmps) ++RTMP_PROTOCOL(ffrtmpt) ++RTMP_PROTOCOL(ffrtmpte) ++RTMP_PROTOCOL(ffrtmpts) diff --git a/package/ffmpeg/patches/ffmpeg-4.4-hls_replace_key_uri.patch b/package/ffmpeg/patches/4_04_hls_replace_key_uri.patch similarity index 69% rename from package/ffmpeg/patches/ffmpeg-4.4-hls_replace_key_uri.patch rename to package/ffmpeg/patches/4_04_hls_replace_key_uri.patch index de620e7e..7c5739de 100644 --- a/package/ffmpeg/patches/ffmpeg-4.4-hls_replace_key_uri.patch +++ b/package/ffmpeg/patches/4_04_hls_replace_key_uri.patch @@ -1,21 +1,21 @@ --- a/libavformat/hls.c +++ b/libavformat/hls.c -@@ -212,6 +212,8 @@ +@@ -209,6 +209,8 @@ + AVDictionary *avio_opts; + char *allowed_extensions; + int max_reload; ++ char *key_uri_replace_old; ++ char *key_uri_replace_new; int http_persistent; int http_multiple; int http_seekable; -+ char *key_uri_replace_old; -+ char *key_uri_replace_new; - AVIOContext *playlist_pb; - } HLSContext; - -@@ -1250,8 +1252,16 @@ +@@ -1243,8 +1245,16 @@ } else if (seg->key_type == KEY_AES_128) { char iv[33], key[33], url[MAX_URL_SIZE]; if (strcmp(seg->key, pls->key_url)) { + char *key_url = NULL; AVIOContext *pb = NULL; -- if (open_url(pls->parent, &pb, seg->key, &c->avio_opts, opts, NULL) == 0) { +- if (open_url(pls->parent, &pb, seg->key, c->avio_opts, opts, NULL) == 0) { + if (NULL != c->key_uri_replace_old && \ + NULL != c-> key_uri_replace_new && \ + '\0' != c->key_uri_replace_old[0]) { @@ -27,7 +27,7 @@ ret = avio_read(pb, pls->key, sizeof(pls->key)); if (ret != sizeof(pls->key)) { av_log(pls->parent, AV_LOG_ERROR, "Unable to read key file %s\n", -@@ -1263,6 +1273,8 @@ +@@ -1256,6 +1266,8 @@ seg->key); } av_strlcpy(pls->key_url, seg->key, sizeof(pls->key_url)); @@ -36,12 +36,12 @@ } ff_data_to_hex(iv, seg->iv, sizeof(seg->iv), 0); ff_data_to_hex(key, pls->key, sizeof(pls->key), 0); -@@ -2399,6 +2411,8 @@ - OFFSET(http_multiple), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, FLAGS}, - {"http_seekable", "Use HTTP partial requests, 0 = disable, 1 = enable, -1 = auto", - OFFSET(http_seekable), AV_OPT_TYPE_BOOL, { .i64 = -1}, -1, 1, FLAGS}, +@@ -2369,6 +2381,8 @@ + INT_MIN, INT_MAX, FLAGS}, + {"max_reload", "Maximum number of times a insufficient list is attempted to be reloaded", + OFFSET(max_reload), AV_OPT_TYPE_INT, {.i64 = 1000}, 0, INT_MAX, FLAGS}, + { "key_uri_old", "allow to replace part of AES key uri - old", OFFSET(key_uri_replace_old), AV_OPT_TYPE_STRING, { .str = "" }, 0, 0, FLAGS }, + { "key_uri_new", "allow to replace part of AES key uri - new", OFFSET(key_uri_replace_new), AV_OPT_TYPE_STRING, { .str = "" }, 0, 0, FLAGS }, - {NULL} - }; - + {"m3u8_hold_counters", "The maximum number of times to load m3u8 when it refreshes without new segments", + OFFSET(m3u8_hold_counters), AV_OPT_TYPE_INT, {.i64 = 1000}, 0, INT_MAX, FLAGS}, + {"http_persistent", "Use persistent HTTP connections", diff --git a/package/ffmpeg/patches/ffmpeg-4.4-optimize_aac.patch b/package/ffmpeg/patches/4_06_optimize_aac.patch similarity index 95% rename from package/ffmpeg/patches/ffmpeg-4.4-optimize_aac.patch rename to package/ffmpeg/patches/4_06_optimize_aac.patch index b46fa5fc..f0e6d43f 100644 --- a/package/ffmpeg/patches/ffmpeg-4.4-optimize_aac.patch +++ b/package/ffmpeg/patches/4_06_optimize_aac.patch @@ -1,6 +1,6 @@ --- a/libavcodec/aacdec_template.c +++ b/libavcodec/aacdec_template.c -@@ -2583,7 +2583,7 @@ +@@ -2485,7 +2485,7 @@ * @param decode 1 if tool is used normally, 0 if tool is used in LTP. * @param coef spectral coefficients */ @@ -11,7 +11,7 @@ const int mmm = FFMIN(ics->tns_max_bands, ics->max_sfb); --- a/libavcodec/aacps.c +++ b/libavcodec/aacps.c -@@ -396,7 +396,7 @@ +@@ -659,7 +659,7 @@ par[ 1] = AAC_HALF_SUM(par[ 0], par[ 1]); } @@ -22,7 +22,7 @@ LOCAL_ALIGNED_16(INTFLOAT, transient_gain, [34], [PS_QMF_TIME_SLOTS]); --- a/libavcodec/fft_template.c +++ b/libavcodec/fft_template.c -@@ -546,7 +546,7 @@ +@@ -562,7 +562,7 @@ pass(z,FFT_NAME(ff_cos_##n),n4/2);\ } @@ -31,7 +31,7 @@ { FFTDouble t1, t2, t3, t4, t5, t6, t7, t8; -@@ -560,7 +560,7 @@ +@@ -576,7 +576,7 @@ BF(z[2].im, z[0].im, t2, t5); } diff --git a/package/ffmpeg/patches/ffmpeg-4.4-increase_buffer_size.patch b/package/ffmpeg/patches/4_07_increase_buffer_size.patch similarity index 97% rename from package/ffmpeg/patches/ffmpeg-4.4-increase_buffer_size.patch rename to package/ffmpeg/patches/4_07_increase_buffer_size.patch index b51df0af..ad57695e 100644 --- a/package/ffmpeg/patches/ffmpeg-4.4-increase_buffer_size.patch +++ b/package/ffmpeg/patches/4_07_increase_buffer_size.patch @@ -9,7 +9,7 @@ /** * Do seeks within this distance ahead of the current buffer by skipping -@@ -556,15 +556,15 @@ +@@ -548,15 +548,15 @@ } /* make buffer smaller in case it ended up large after probing */ diff --git a/package/ffmpeg/patches/ffmpeg-4.4-recheck_discard_flags.patch b/package/ffmpeg/patches/4_08_recheck_discard_flags.patch similarity index 94% rename from package/ffmpeg/patches/ffmpeg-4.4-recheck_discard_flags.patch rename to package/ffmpeg/patches/4_08_recheck_discard_flags.patch index 3f98f131..ff103fb6 100644 --- a/package/ffmpeg/patches/ffmpeg-4.4-recheck_discard_flags.patch +++ b/package/ffmpeg/patches/4_08_recheck_discard_flags.patch @@ -1,6 +1,6 @@ --- a/libavformat/hls.c +++ b/libavformat/hls.c -@@ -2165,8 +2165,10 @@ +@@ -2142,8 +2142,10 @@ HLSContext *c = s->priv_data; int ret, i, minplaylist = -1; diff --git a/package/ffmpeg/patches/ffmpeg-4.4-fix_edit_list_parsing.patch b/package/ffmpeg/patches/4_09_ffmpeg_fix_edit_list_parsing.patch similarity index 96% rename from package/ffmpeg/patches/ffmpeg-4.4-fix_edit_list_parsing.patch rename to package/ffmpeg/patches/4_09_ffmpeg_fix_edit_list_parsing.patch index 007f79cb..b5631ee4 100644 --- a/package/ffmpeg/patches/ffmpeg-4.4-fix_edit_list_parsing.patch +++ b/package/ffmpeg/patches/4_09_ffmpeg_fix_edit_list_parsing.patch @@ -1,6 +1,6 @@ --- a/libavformat/mov.c +++ b/libavformat/mov.c -@@ -3634,8 +3634,10 @@ +@@ -3615,8 +3615,10 @@ if (ctts_data_old && ctts_index_old < ctts_count_old) { curr_ctts = ctts_data_old[ctts_index_old].duration; diff --git a/package/ffmpeg/patches/ffmpeg-4.4-rtsp.patch b/package/ffmpeg/patches/4_11_rtsp.patch similarity index 89% rename from package/ffmpeg/patches/ffmpeg-4.4-rtsp.patch rename to package/ffmpeg/patches/4_11_rtsp.patch index 20f83da8..9ee24cf3 100644 --- a/package/ffmpeg/patches/ffmpeg-4.4-rtsp.patch +++ b/package/ffmpeg/patches/4_11_rtsp.patch @@ -1,15 +1,16 @@ --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c -@@ -2380,6 +2380,8 @@ static int sdp_read_header(AVFormatContext *s) +@@ -2338,7 +2338,9 @@ + RTSPStream *rtsp_st; int size, i, err; char *content; - char url[MAX_URL_SIZE]; + const char *p, *sp="", *sources="", *sp2, *sources2; + char url[1024]; + char sources_buf[1024]; if (!ff_network_init()) return AVERROR(EIO); -@@ -2408,6 +2410,16 @@ static int sdp_read_header(AVFormatContext *s) +@@ -2364,6 +2366,16 @@ av_freep(&content); if (err) goto fail; @@ -26,7 +27,7 @@ /* open each RTP stream */ for (i = 0; i < rt->nb_rtsp_streams; i++) { char namebuf[50]; -@@ -2425,12 +2437,22 @@ static int sdp_read_header(AVFormatContext *s) +@@ -2381,12 +2393,22 @@ av_dict_free(&opts); goto fail; } diff --git a/package/ffmpeg/patches/ffmpeg-4.4-dxva2.patch b/package/ffmpeg/patches/4_12_dxva2.patch similarity index 87% rename from package/ffmpeg/patches/ffmpeg-4.4-dxva2.patch rename to package/ffmpeg/patches/4_12_dxva2.patch index de245dfd..434cd27f 100644 --- a/package/ffmpeg/patches/ffmpeg-4.4-dxva2.patch +++ b/package/ffmpeg/patches/4_12_dxva2.patch @@ -1,6 +1,6 @@ --- a/libavcodec/dxva2.c +++ b/libavcodec/dxva2.c -@@ -777,16 +777,18 @@ +@@ -771,16 +771,18 @@ #if CONFIG_D3D11VA if (avctx->pix_fmt == AV_PIX_FMT_D3D11) return (intptr_t)frame->data[1]; @@ -42,7 +42,7 @@ &ctx_pic->qm, sizeof(ctx_pic->qm), --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c -@@ -942,6 +942,7 @@ +@@ -928,6 +928,7 @@ h->first_field = 0; h->prev_interlaced_frame = 1; @@ -52,7 +52,7 @@ ret = ff_h264_alloc_tables(h); --- a/libavcodec/h264dec.c +++ b/libavcodec/h264dec.c -@@ -442,6 +442,7 @@ +@@ -467,6 +467,7 @@ h->next_outputed_poc = INT_MIN; h->prev_interlaced_frame = 1; @@ -62,7 +62,7 @@ h->poc.prev_frame_num = -1; --- a/libavcodec/h264dec.h +++ b/libavcodec/h264dec.h -@@ -540,6 +540,8 @@ +@@ -539,6 +539,8 @@ * slices) anymore */ int setup_finished; @@ -71,6 +71,20 @@ int cur_chroma_format_idc; int cur_bit_depth_luma; int16_t slice_row[MAX_SLICES]; ///< to detect when MAX_SLICES is too low +--- a/libavcodec/vaapi_h264.c ++++ b/libavcodec/vaapi_h264.c +@@ -314,6 +314,11 @@ + H264SliceContext *sl = &h->slice_ctx[0]; + int ret; + ++ if (pic->nb_slices == 0) { ++ ret = AVERROR_INVALIDDATA; ++ goto finish; ++ } ++ + ret = ff_vaapi_decode_issue(avctx, pic); + if (ret < 0) + goto finish; --- a/libavformat/bintext.c +++ b/libavformat/bintext.c @@ -149,7 +149,7 @@ diff --git a/package/ffmpeg/patches/4_mips64_cpu_detection.patch b/package/ffmpeg/patches/4_mips64_cpu_detection.patch new file mode 100644 index 00000000..59131a6c --- /dev/null +++ b/package/ffmpeg/patches/4_mips64_cpu_detection.patch @@ -0,0 +1,30 @@ +It will add -mips64r6 and -mips64r2 to cmdline which will +cause conflicts + +in OE we user mips32r2 and mips64r2 for mips arch versions +so there is no benefit of detecting it automatically by +poking at tools especially in cross env + +Fixes errors like + +linking -mnan=2008 module with previous -mnan=legacy modules +failed to merge target specific data of file + +-Khem +Upstream-Status: Inappropriate [OE-Specific] + +--- a/configure ++++ b/configure +@@ -5847,12 +5847,9 @@ + + # Enable minimum ISA based on selected options + if enabled mips64; then +- enabled mips64r6 && check_inline_asm_flags mips64r6 '"dlsa $0, $0, $0, 1"' '-mips64r6' + enabled mips64r2 && check_inline_asm_flags mips64r2 '"dext $0, $0, 0, 1"' '-mips64r2' + disabled mips64r6 && disabled mips64r2 && check_inline_asm_flags mips64r1 '"daddi $0, $0, 0"' '-mips64' + else +- enabled mips32r6 && check_inline_asm_flags mips32r6 '"aui $0, $0, 0"' '-mips32r6' +- enabled mips32r5 && check_inline_asm_flags mips32r5 '"eretnc"' '-mips32r5' + enabled mips32r2 && check_inline_asm_flags mips32r2 '"ext $0, $0, 0, 1"' '-mips32r2' + disabled mips32r6 && disabled mips32r5 && disabled mips32r2 && check_inline_asm_flags mips32r1 '"addi $0, $0, 0"' '-mips32' + fi diff --git a/package/ffmpeg/patches/ffmpeg-4.4-INT64-fix.patch b/package/ffmpeg/patches/ffmpeg-4.4-INT64-fix.patch deleted file mode 100644 index 37cc437e..00000000 --- a/package/ffmpeg/patches/ffmpeg-4.4-INT64-fix.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- a/libavutil/common.h_org 2020-05-16 14:06:14.551152997 +0200 -+++ b/libavutil/common.h 2020-05-17 18:59:28.020443989 +0200 -@@ -30,6 +30,14 @@ - #error missing -D__STDC_CONSTANT_MACROS / #define __STDC_CONSTANT_MACROS - #endif - -+#ifndef INT64_MAX -+#define INT64_MAX 0x7fffffffffffffffLL -+#endif -+ -+#ifndef INT64_MIN -+#define INT64_MIN (-INT64_MAX - 1LL) -+#endif -+ - #include - #include - #include diff --git a/package/ffmpeg/patches/ffmpeg-4.4-mips64_cpu_detection.patch b/package/ffmpeg/patches/ffmpeg-4.4-mips64_cpu_detection.patch deleted file mode 100644 index 5582ba47..00000000 --- a/package/ffmpeg/patches/ffmpeg-4.4-mips64_cpu_detection.patch +++ /dev/null @@ -1,32 +0,0 @@ -in OE we user mips32r2 and mips64r2 for mips arch versions -so there is no benefit of detecting it automatically by -poking at tools especially in cross env - -Fixes errors like - -linking -mnan=2008 module with previous -mnan=legacy modules -failed to merge target specific data of file - --Khem -Upstream-Status: Inappropriate [OE-Specific] - ---- a/configure -+++ b/configure -@@ -5885,17 +5885,10 @@ - - # Check toolchain ISA level - if enabled mips64; then -- enabled mips64r6 && check_inline_asm mips64r6 '"dlsa $0, $0, $0, 1"' && -- disable mips64r2 -- - enabled mips64r2 && check_inline_asm mips64r2 '"dext $0, $0, 0, 1"' - - disable mips32r6 && disable mips32r5 && disable mips32r2 - else -- enabled mips32r6 && check_inline_asm mips32r6 '"aui $0, $0, 0"' && -- disable mips32r5 && disable mips32r2 -- -- enabled mips32r5 && check_inline_asm mips32r5 '"eretnc"' - enabled mips32r2 && check_inline_asm mips32r2 '"ext $0, $0, 0, 1"' - - disable mips64r6 && disable mips64r5 && disable mips64r2