]> git.sesse.net Git - vlc/blobdiff - modules/services_discovery/sap.c
Fix description
[vlc] / modules / services_discovery / sap.c
index a666469609e6962a1c0e380c8a587a48c2f0b750..9b89a6e3a5f3ba9e2cd87bb4693b4e450a61978d 100644 (file)
 #define SAP_PARSE_TEXT N_( "Try to parse the announce" )
 #define SAP_PARSE_LONGTEXT N_( \
        "This enables actual parsing of the announces by the SAP module. " \
-       "Otherwise, all announcements are parsed by the \"livedotcom\" " \
+       "Otherwise, all announcements are parsed by the \"live555\" " \
        "(RTP/RTSP) module." )
 #define SAP_STRICT_TEXT N_( "SAP Strict mode" )
 #define SAP_STRICT_LONGTEXT N_( \
@@ -394,10 +394,19 @@ static int OpenDemux( vlc_object_t *p_this )
     {
         p_sdp->psz_uri = NULL;
     }
-    if( p_sdp->i_media_type != 33 && p_sdp->i_media_type != 32 &&
-        p_sdp->i_media_type != 14 )
-        goto error;
-
+    switch (p_sdp->i_media_type)
+    {   /* Should be in sync with modules/demux/rtp.c */
+        case  0: /* PCMU/8000 */
+        case  8: /* PCMA/8000 */
+        case 10: /* L16/44100/2 */
+        case 11: /* L16/44100 */
+        case 14: /* MPA/90000 */
+        case 32: /* MPV/90000 */
+        case 33: /* MP2/90000 */
+            break;
+        default:
+            goto error;
+    }
     if( p_sdp->psz_uri == NULL ) goto error;
 
     p_demux->p_sys = (demux_sys_t *)malloc( sizeof(demux_sys_t) );
@@ -808,7 +817,11 @@ static int ParseSAP( services_discovery_t *p_sd, const uint8_t *buf,
             p_sdp->psz_uri = NULL;
     }
 
-    if( p_sdp->psz_uri == NULL ) return VLC_EGENERIC;
+    if( p_sdp->psz_uri == NULL )
+    {
+        FreeSDP( p_sdp );
+        return VLC_EGENERIC;
+    }
 
     for( i = 0 ; i< p_sd->p_sys->i_announces ; i++ )
     {