[FFmpeg-cvslog] r21056 - trunk/libavformat/sdp.c

lucabe subversion
Thu Jan 7 09:11:56 CET 2010


Author: lucabe
Date: Thu Jan  7 09:11:56 2010
New Revision: 21056

Log:
Check the URL used for the SDP destination.
Patch by Martin Storsjo (martin AT martin DOT st)

Modified:
   trunk/libavformat/sdp.c

Modified: trunk/libavformat/sdp.c
==============================================================================
--- trunk/libavformat/sdp.c	Thu Jan  7 07:32:34 2010	(r21055)
+++ trunk/libavformat/sdp.c	Thu Jan  7 09:11:56 2010	(r21056)
@@ -18,6 +18,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <string.h>
 #include "libavutil/avstring.h"
 #include "libavutil/base64.h"
 #include "avformat.h"
@@ -72,10 +73,19 @@ static int sdp_get_address(char *dest_ad
 {
     int port;
     const char *p;
+    char proto[32];
 
-    url_split(NULL, 0, NULL, 0, dest_addr, size, &port, NULL, 0, url);
+    url_split(proto, sizeof(proto), NULL, 0, dest_addr, size, &port, NULL, 0, url);
 
     *ttl = 0;
+
+    if (strcmp(proto, "rtp")) {
+        /* The url isn't for the actual rtp sessions,
+         * don't parse out anything else than the destination.
+         */
+        return 0;
+    }
+
     p = strchr(url, '?');
     if (p) {
         char buff[64];



More information about the ffmpeg-cvslog mailing list