]> git.sesse.net Git - vlc/blobdiff - modules/services_discovery/sap.c
add_bool wants booleans.
[vlc] / modules / services_discovery / sap.c
index 5859be5f29083ac448f5ff3849ef49406ec5f440..234d98fe27b005911ffb8f77d55f18cbe39d203a 100644 (file)
@@ -128,18 +128,18 @@ vlc_module_begin ()
 
     add_string( "sap-addr", NULL, NULL,
                 SAP_ADDR_TEXT, SAP_ADDR_LONGTEXT, true )
-    add_bool( "sap-ipv4", , NULL,
+    add_bool( "sap-ipv4", true, NULL,
                SAP_IPV4_TEXT,SAP_IPV4_LONGTEXT, true )
-    add_bool( "sap-ipv6", , NULL,
+    add_bool( "sap-ipv6", true, NULL,
               SAP_IPV6_TEXT, SAP_IPV6_LONGTEXT, true )
     add_integer( "sap-timeout", 1800, NULL,
                  SAP_TIMEOUT_TEXT, SAP_TIMEOUT_LONGTEXT, true )
-    add_bool( "sap-parse", , NULL,
+    add_bool( "sap-parse", true, NULL,
                SAP_PARSE_TEXT,SAP_PARSE_LONGTEXT, true )
-    add_bool( "sap-strict", , NULL,
+    add_bool( "sap-strict", false, NULL,
                SAP_STRICT_TEXT,SAP_STRICT_LONGTEXT, true )
 #if 0
-    add_bool( "sap-cache", , NULL,
+    add_bool( "sap-cache", false, NULL,
                SAP_CACHE_TEXT,SAP_CACHE_LONGTEXT, true )
 #endif
     add_obsolete_bool( "sap-timeshift" ) /* Redumdant since 1.0.0 */
@@ -290,9 +290,11 @@ static bool IsWellKnownPayload (int type)
     switch (type)
     {   /* Should be in sync with modules/demux/rtp.c */
         case  0: /* PCMU/8000 */
+        case  3:
         case  8: /* PCMA/8000 */
         case 10: /* L16/44100/2 */
         case 11: /* L16/44100 */
+        case 12:
         case 14: /* MPA/90000 */
         case 32: /* MPV/90000 */
         case 33: /* MP2/90000 */
@@ -649,8 +651,7 @@ static int Demux( demux_t *p_demux )
     input_thread_t *p_input;
     input_item_t *p_parent_input;
 
-    p_input = (input_thread_t *)vlc_object_find( p_demux, VLC_OBJECT_INPUT,
-                                                 FIND_PARENT );
+    p_input = demux_GetParentInput( p_demux );
     assert( p_input );
     if( !p_input )
     {
@@ -916,9 +917,11 @@ static const char *FindAttribute (const sdp_t *sdp, unsigned media,
                                   const char *name)
 {
     /* Look for media attribute, and fallback to session */
-    return GetAttribute (sdp->mediav[media].pp_attributes,
-                         sdp->mediav[media].i_attributes, name)
-        ?: GetAttribute (sdp->pp_attributes, sdp->i_attributes, name);
+    const char *attr = GetAttribute (sdp->mediav[media].pp_attributes,
+                                     sdp->mediav[media].i_attributes, name);
+    if (attr == NULL)
+        attr = GetAttribute (sdp->pp_attributes, sdp->i_attributes, name);
+    return attr;
 }
 
 
@@ -1489,6 +1492,7 @@ static int Decompress( const unsigned char *psz_src, unsigned char **_dst, int i
         if( ( i_result != Z_OK ) && ( i_result != Z_STREAM_END ) )
         {
             inflateEnd( &d_stream );
+            free( psz_dst );
             return( -1 );
         }
     }