[FFmpeg-cvslog] rtmp: Do not send extension for flv files

Samuel Pitoiset git at videolan.org
Mon Jun 11 21:58:59 CEST 2012


ffmpeg | branch: master | Samuel Pitoiset <samuel.pitoiset at gmail.com> | Thu Jun  7 17:46:34 2012 +0200| [f862537de8ba7920e0f25318c03f8982a3c6294c] | committer: Martin Storsjö

rtmp: Do not send extension for flv files

This fixes bugzilla bug #304.

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f862537de8ba7920e0f25318c03f8982a3c6294c
---

 libavformat/rtmpproto.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index abf9ab4..e9a3e43 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -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;
         }



More information about the ffmpeg-cvslog mailing list