diff options
author | Steven Liu <lq@chinaffmpeg.org> | 2019-08-29 17:33:34 +0800 |
---|---|---|
committer | Steven Liu <lq@chinaffmpeg.org> | 2019-09-02 13:40:19 +0800 |
commit | 2a21487b9ea1ec5f24a9f09cd3845fa2eb6ed383 (patch) | |
tree | 9abaae066dded32160236c686967a53030d5b574 /libavformat/dashdec.c | |
parent | 2183def1a54c4787aac6ac1691b2b69dd43077df (diff) | |
download | ffmpeg-streaming-2a21487b9ea1ec5f24a9f09cd3845fa2eb6ed383.zip ffmpeg-streaming-2a21487b9ea1ec5f24a9f09cd3845fa2eb6ed383.tar.gz |
avformat/dashdec: start from the root uri when baseURL is start with '/'
fix ticket: 8097
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Diffstat (limited to 'libavformat/dashdec.c')
-rw-r--r-- | libavformat/dashdec.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c index f82a750..a6f7551 100644 --- a/libavformat/dashdec.c +++ b/libavformat/dashdec.c @@ -794,12 +794,22 @@ static int resolve_content_path(AVFormatContext *s, const char *url, int *max_ur continue; } text = xmlNodeGetContent(baseurl_nodes[i]); - if (text) { + if (text && !av_strstart(text, "/", NULL)) { memset(tmp_str, 0, strlen(tmp_str)); if (!ishttp(text) && isRootHttp) { av_strlcpy(tmp_str, root_url, size + 1); } start = (text[0] == token); + if (start && av_stristr(tmp_str, text)) { + char *p = tmp_str; + if (!av_strncasecmp(tmp_str, "http://", 7)) { + p += 7; + } else if (!av_strncasecmp(tmp_str, "https://", 8)) { + p += 8; + } + p = strchr(p, '/'); + memset(p + 1, 0, strlen(p)); + } av_strlcat(tmp_str, text + start, tmp_max_url_size); xmlNodeSetContent(baseurl_nodes[i], tmp_str); updated = 1; |