]> granicus.if.org Git - rtmpdump/commitdiff
Don't strip suffix if prefix was already present
authorhyc <hyc@400ebc74-4327-4243-bc38-086b20814532>
Thu, 29 Apr 2010 23:33:33 +0000 (23:33 +0000)
committerhyc <hyc@400ebc74-4327-4243-bc38-086b20814532>
Thu, 29 Apr 2010 23:33:33 +0000 (23:33 +0000)
git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@455 400ebc74-4327-4243-bc38-086b20814532

librtmp/parseurl.c

index 19c8191cff4e91ad2f7d79bd44d113b4467f0df9..f8edeb312bb14012da03f4ee8769bde6ba4cdd6b 100644 (file)
@@ -241,12 +241,20 @@ void RTMP_ParsePlaypath(AVal *in, AVal *out) {
                return;
 
        destptr = streamname;
-       if (addMP4 && (strncmp(ppstart, "mp4:", 4) != 0)) {
-               strcpy(destptr, "mp4:");
-               destptr += 4;
-       } else if (addMP3 && (strncmp(ppstart, "mp3:", 4) != 0)) {
-               strcpy(destptr, "mp3:");
-               destptr += 4;
+       if (addMP4) {
+               if (strncmp(ppstart, "mp4:", 4)) {
+                       strcpy(destptr, "mp4:");
+                       destptr += 4;
+               } else {
+                       subExt = 0;
+               }
+       } else if (addMP3) {
+               if (strncmp(ppstart, "mp3:", 4)) {
+                       strcpy(destptr, "mp3:");
+                       destptr += 4;
+               } else {
+                       subExt = 0;
+               }
        }
 
        for (p=(char *)ppstart; pplen >0;) {