[SCM] libav/experimental: applehttp: Handle absolute paths relative to the current server

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 17:23:12 UTC 2013


The following commit has been merged in the experimental branch:
commit 185a155e5701cfaa0281bf91a5a140d498aa0a7f
Author: Martin Storsjö <martin at martin.st>
Date:   Fri Feb 4 11:09:48 2011 +0200

    applehttp: Handle absolute paths relative to the current server
    
    This fixes roundup issue 2583.
    
    Signed-off-by: Ronald S. Bultje <rsbultje at gmail.com>

diff --git a/libavformat/applehttp.c b/libavformat/applehttp.c
index 50466fa..37a040c 100644
--- a/libavformat/applehttp.c
+++ b/libavformat/applehttp.c
@@ -90,6 +90,20 @@ static void make_absolute_url(char *buf, int size, const char *base,
                               const char *rel)
 {
     char *sep;
+    /* Absolute path, relative to the current server */
+    if (base && strstr(base, "://") && rel[0] == '/') {
+        if (base != buf)
+            av_strlcpy(buf, base, size);
+        sep = strstr(buf, "://");
+        if (sep) {
+            sep += 3;
+            sep = strchr(sep, '/');
+            if (sep)
+                *sep = '\0';
+        }
+        av_strlcat(buf, rel, size);
+        return;
+    }
     /* If rel actually is an absolute url, just copy it */
     if (!base || strstr(rel, "://") || rel[0] == '/') {
         av_strlcpy(buf, rel, size);

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list