From d83ebe7f3f4fb217b293caff327ac527b61322d9 Mon Sep 17 00:00:00 2001 From: Hitesh Kumar Saini Date: Tue, 27 Feb 2024 17:07:15 +0530 Subject: [PATCH] build: update FFmpeg patches --- packages/ffmpeg-dash-base-url-escape.patch | 52 +++++++++++----------- packages/ffmpeg-fix-hls-mp4-seek.patch | 28 ++++++------ 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/packages/ffmpeg-dash-base-url-escape.patch b/packages/ffmpeg-dash-base-url-escape.patch index b403b139..36ed6d5b 100644 --- a/packages/ffmpeg-dash-base-url-escape.patch +++ b/packages/ffmpeg-dash-base-url-escape.patch @@ -1,26 +1,26 @@ -diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c -index 29d4680..c50afaf 100644 ---- a/libavformat/dashdec.c -+++ b/libavformat/dashdec.c -@@ -768,7 +768,9 @@ static int resolve_content_path(AVFormatContext *s, const char *url, int *max_ur - baseurl = xmlNodeGetContent(node); - root_url = (av_strcasecmp(baseurl, "")) ? baseurl : path; - if (node) { -- xmlNodeSetContent(node, root_url); -+ char* root_url_content = xmlEncodeSpecialChars(NULL, root_url); -+ xmlNodeSetContent(node, root_url_content); -+ xmlFree(root_url_content); - updated = 1; - } - -@@ -802,7 +804,9 @@ static int resolve_content_path(AVFormatContext *s, const char *url, int *max_ur - memset(p + 1, 0, strlen(p)); - } - av_strlcat(tmp_str, text + start, tmp_max_url_size); -- xmlNodeSetContent(baseurl_nodes[i], tmp_str); -+ char* tmp_str_content = xmlEncodeSpecialChars(NULL, tmp_str); -+ xmlNodeSetContent(baseurl_nodes[i], tmp_str_content); -+ xmlFree(tmp_str_content); - updated = 1; - xmlFree(text); - } +diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c +index 29d4680..c50afaf 100644 +--- a/libavformat/dashdec.c ++++ b/libavformat/dashdec.c +@@ -768,7 +768,9 @@ static int resolve_content_path(AVFormatContext *s, const char *url, int *max_ur + baseurl = xmlNodeGetContent(node); + root_url = (av_strcasecmp(baseurl, "")) ? baseurl : path; + if (node) { +- xmlNodeSetContent(node, root_url); ++ char* root_url_content = xmlEncodeSpecialChars(NULL, root_url); ++ xmlNodeSetContent(node, root_url_content); ++ xmlFree(root_url_content); + updated = 1; + } + +@@ -802,7 +804,9 @@ static int resolve_content_path(AVFormatContext *s, const char *url, int *max_ur + memset(p + 1, 0, strlen(p)); + } + av_strlcat(tmp_str, text + start, tmp_max_url_size); +- xmlNodeSetContent(baseurl_nodes[i], tmp_str); ++ char* tmp_str_content = xmlEncodeSpecialChars(NULL, tmp_str); ++ xmlNodeSetContent(baseurl_nodes[i], tmp_str_content); ++ xmlFree(tmp_str_content); + updated = 1; + xmlFree(text); + } diff --git a/packages/ffmpeg-fix-hls-mp4-seek.patch b/packages/ffmpeg-fix-hls-mp4-seek.patch index 3b04eccf..58bffcef 100644 --- a/packages/ffmpeg-fix-hls-mp4-seek.patch +++ b/packages/ffmpeg-fix-hls-mp4-seek.patch @@ -1,14 +1,14 @@ -diff --git a/libavformat/hls.c b/libavformat/hls.c -index 2a2fe28a540f..c625e3029116 100644 ---- a/libavformat/hls.c -+++ b/libavformat/hls.c -@@ -2506,6 +2506,9 @@ static int hls_read_seek(AVFormatContext *s, int stream_index, - /* Flush the packet queue of the subdemuxer. */ - ff_read_frame_flush(pls->ctx); - -+ /* Reset the init segment so it's re-fetched and served appropiately */ -+ pls->cur_init_section = NULL; -+ - pls->seek_timestamp = seek_timestamp; - pls->seek_flags = flags; - +diff --git a/libavformat/hls.c b/libavformat/hls.c +index 2a2fe28a540f..c625e3029116 100644 +--- a/libavformat/hls.c ++++ b/libavformat/hls.c +@@ -2506,6 +2506,9 @@ static int hls_read_seek(AVFormatContext *s, int stream_index, + /* Flush the packet queue of the subdemuxer. */ + ff_read_frame_flush(pls->ctx); + ++ /* Reset the init segment so it's re-fetched and served appropiately */ ++ pls->cur_init_section = NULL; ++ + pls->seek_timestamp = seek_timestamp; + pls->seek_flags = flags; +