]> git.sesse.net Git - vlc/commitdiff
SAP: m= subtype is not supposed to be a number in with the "udp"
authorRémi Denis-Courmont <rem@videolan.org>
Wed, 19 Mar 2008 17:31:15 +0000 (19:31 +0200)
committerRémi Denis-Courmont <rem@videolan.org>
Wed, 19 Mar 2008 17:31:15 +0000 (19:31 +0200)
protocol, so don't try to use atoi() there.

modules/services_discovery/sap.c

index ebda11fcc9449e854c1977331982dde5a127c69f..d5912482b1798b23ce756f65f1ff2b376205bdce 100644 (file)
@@ -969,15 +969,19 @@ static int ParseConnection( vlc_object_t *p_obj, sdp_t *p_sdp )
     if (subtype == NULL)
     {
         msg_Dbg (p_obj, "missing SDP media subtype: %s", sdp_proto);
-        p_sdp->i_media_type = 0;
+        free (sdp_proto);
+        return VLC_EGENERIC;
     }
     else
     {
         *subtype++ = '\0';
-        p_sdp->i_media_type = atoi (subtype);
+        /* FIXME: check for multiple payload types in RTP/AVP case.
+         * FIXME: check for "mpeg" subtype in raw udp case. */
+        if (!strcasecmp (sdp_proto, "udp"))
+            p_sdp->i_media_type = 33;
+        else
+            p_sdp->i_media_type = atoi (subtype);
     }
-    if (p_sdp->i_media_type == 0)
-         p_sdp->i_media_type = 33;
 
     /* RTP protocol, nul, VLC shortcut, nul, flags byte as follow:
      * 0x1: Connection-Oriented media. */