From: hyc Date: Thu, 29 Apr 2010 23:33:33 +0000 (+0000) Subject: Don't strip suffix if prefix was already present X-Git-Tag: v2.4~96 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e4e4b0b32c732a1448707d3450d6080166cc15e2;p=rtmpdump Don't strip suffix if prefix was already present git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@455 400ebc74-4327-4243-bc38-086b20814532 --- diff --git a/librtmp/parseurl.c b/librtmp/parseurl.c index 19c8191..f8edeb3 100644 --- a/librtmp/parseurl.c +++ b/librtmp/parseurl.c @@ -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;) {