From: Duncan Salerno <[email protected]>
---
libavformat/url-test.c | 1 +
libavformat/utils.c | 6 ++++++
tests/ref/fate/url | 1 +
3 files changed, 8 insertions(+)
diff --git a/libavformat/url-test.c b/libavformat/url-test.c
index aa07ffa..5c0bccb 100644
--- a/libavformat/url-test.c
+++ b/libavformat/url-test.c
@@ -52,5 +52,6 @@ int main(int argc, char **argv)
test("http://server/foo/bar/123", "/baz");
test("http://server/foo/bar/123", "https://other/url");
test("http://server/foo/bar?param=value/with/slashes", "/baz");
+ test("http://server/foo/bar?param&otherparam", "?someparam");
return 0;
}
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 2b20f65..6833de4 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3417,6 +3417,12 @@ void ff_make_absolute_url(char *buf, int size, const
char *base,
if (path_query != NULL)
*path_query = '\0';
+ /* Is relative path just a new query part? */
+ if (rel[0] == '?') {
+ av_strlcat(buf, rel, size);
+ return;
+ }
+
/* Remove the file name from the base url */
sep = strrchr(buf, '/');
if (sep)
diff --git a/tests/ref/fate/url b/tests/ref/fate/url
index bf85a97..b1e91fb 100644
--- a/tests/ref/fate/url
+++ b/tests/ref/fate/url
@@ -9,3 +9,4 @@ http://server/baz
http://server/baz
https://other/url
http://server/baz
+http://server/foo/bar?someparam
--
1.7.9.4
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel