changeset 5214:dd04eacd063b libavformat

Do not include "mp4:" prefix from RTMP URL into "app" path or second time into playpath. Patch by Lars T¸«£uber (<$name> . <$lastname with umlaut replaced with diphtong> @ <gmx> . <net>)
author kostya
date Thu, 17 Sep 2009 05:31:02 +0000
parents d7558c9ed907
children 6fc9f9d8aaa1
files rtmpproto.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/rtmpproto.c	Wed Sep 16 20:44:26 2009 +0000
+++ b/rtmpproto.c	Thu Sep 17 05:31:02 2009 +0000
@@ -611,8 +611,9 @@
                 fname = path + 1;
                 app[0] = '\0';
             } else {
+                char *c = strchr(p + 1, ':');
                 fname = strchr(p + 1, '/');
-                if (!fname) {
+                if (!fname || c < fname) {
                     fname = p + 1;
                     av_strlcpy(app, path + 1, p - path);
                 } else {
@@ -621,8 +622,9 @@
                 }
             }
         }
-        if (!strcmp(fname + strlen(fname) - 4, ".f4v") ||
-            !strcmp(fname + strlen(fname) - 4, ".mp4")) {
+        if (!strchr(fname, ':') &&
+            (!strcmp(fname + strlen(fname) - 4, ".f4v") ||
+             !strcmp(fname + strlen(fname) - 4, ".mp4"))) {
             memcpy(rt->playpath, "mp4:", 5);
         } else {
             rt->playpath[0] = 0;