rtmp: Do not send extension for flv files
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 7 Jun 2012 15:46:34 +0000 (17:46 +0200)
committerMartin Storsjö <martin@martin.st>
Mon, 11 Jun 2012 10:48:39 +0000 (13:48 +0300)
This fixes bugzilla bug #304.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/rtmpproto.c

index abf9ab4..e9a3e43 100644 (file)
@@ -1133,6 +1133,8 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
     }
 
     if (!rt->playpath) {
+        int len = strlen(fname);
+
         rt->playpath = av_malloc(PLAYPATH_MAX_LENGTH);
         if (!rt->playpath) {
             ret = AVERROR(ENOMEM);
@@ -1140,9 +1142,11 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
         }
 
         if (!strchr(fname, ':') &&
-            (!strcmp(fname + strlen(fname) - 4, ".f4v") ||
-             !strcmp(fname + strlen(fname) - 4, ".mp4"))) {
+            (!strcmp(fname + len - 4, ".f4v") ||
+             !strcmp(fname + len - 4, ".mp4"))) {
             memcpy(rt->playpath, "mp4:", 5);
+        } else if (!strcmp(fname + len - 4, ".flv")) {
+            fname[len - 4] = '\0';
         } else {
             rt->playpath[0] = 0;
         }