Skip to content

Commit 7afdcd9

Browse files
committed
ffmpeg 5 add dash patches
1 parent 2fcc0b4 commit 7afdcd9

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
From ca6bf697d914be79fcc4d4314c06101d279b6ef3 Mon Sep 17 00:00:00 2001
2+
From: qianlongxu <qianlongxu@gmail.com>
3+
Date: Wed, 21 May 2025 18:05:52 +0800
4+
Subject: [PATCH] fix dash init fragment url is "invalid:truncated" bug
5+
6+
---
7+
libavformat/dashdec.c | 12 +++++++++++-
8+
1 file changed, 11 insertions(+), 1 deletion(-)
9+
10+
diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
11+
index 0a6c46b..616187f 100644
12+
--- a/libavformat/dashdec.c
13+
+++ b/libavformat/dashdec.c
14+
@@ -477,6 +477,10 @@ static char *get_content_url(xmlNodePtr *baseurl_nodes,
15+
int i;
16+
char *text;
17+
char *url = NULL;
18+
+
19+
+ if (strlen(val) >= max_url_size) {
20+
+ max_url_size += 256;
21+
+ }
22+
char *tmp_str = av_mallocz(max_url_size);
23+
24+
if (!tmp_str)
25+
@@ -495,8 +499,14 @@ static char *get_content_url(xmlNodePtr *baseurl_nodes,
26+
}
27+
}
28+
29+
- if (val)
30+
+ if (val) {
31+
+ int tmp_max_url_size = strlen(tmp_str) + strlen(val) + 1;
32+
+ if (tmp_max_url_size > max_url_size) {
33+
+ max_url_size = tmp_max_url_size;
34+
+ tmp_str = av_realloc(tmp_str, max_url_size);
35+
+ }
36+
ff_make_absolute_url(tmp_str, max_url_size, tmp_str, val);
37+
+ }
38+
39+
if (rep_id_val) {
40+
url = av_strireplace(tmp_str, "$RepresentationID$", rep_id_val);
41+
--
42+
2.39.5 (Apple Git-154)
43+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
From 147a176cf02538367918d931959dbb5071202777 Mon Sep 17 00:00:00 2001
2+
From: qianlongxu <qianlongxu@gmail.com>
3+
Date: Thu, 29 May 2025 09:45:39 +0800
4+
Subject: [PATCH] fix dash file error "unterminated entity reference" due to
5+
ampersand in <baseurl> tag
6+
7+
---
8+
libavformat/dashdec.c | 4 +++-
9+
1 file changed, 3 insertions(+), 1 deletion(-)
10+
11+
diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
12+
index 71d7906..4540ee3 100644
13+
--- a/libavformat/dashdec.c
14+
+++ b/libavformat/dashdec.c
15+
@@ -805,8 +805,10 @@ static int resolve_content_path(AVFormatContext *s, const char *url, int *max_ur
16+
memset(p + 1, 0, strlen(p));
17+
}
18+
av_strlcat(tmp_str, text + start, tmp_max_url_size);
19+
- xmlNodeSetContent(baseurl_nodes[i], tmp_str);
20+
+ xmlChar *escaped = xmlEncodeSpecialChars(NULL, tmp_str);
21+
+ xmlNodeSetContent(baseurl_nodes[i], escaped);
22+
updated = 1;
23+
+ xmlFree(escaped);
24+
xmlFree(text);
25+
}
26+
}
27+
--
28+
2.39.5 (Apple Git-154)
29+

0 commit comments

Comments
 (0)