avio: print a warning from ffurl_alloc() if no protocols are allocated.
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 7 Nov 2011 03:18:53 +0000 (04:18 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 7 Nov 2011 03:24:49 +0000 (04:24 +0100)
Fixes Ticket618

Based on code by teratorn
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/avio.c

index 2bdad73..47b2d51 100644 (file)
@@ -223,6 +223,11 @@ int ffurl_alloc(URLContext **puc, const char *filename, int flags)
     char proto_str[128], proto_nested[128], *ptr;
     size_t proto_len = strspn(filename, URL_SCHEME_CHARS);
 
+    if (!first_protocol) {
+        av_log(NULL, AV_LOG_WARNING, "No URL Protocols are registered. "
+                                     "Missing call to av_register_all()?\n");
+    }
+
     if (filename[proto_len] != ':' || is_dos_path(filename))
         strcpy(proto_str, "file");
     else