]> git.sesse.net Git - vlc/blobdiff - src/control/media_discoverer.c
Use var_Inherit* instead of var_CreateGet*.
[vlc] / src / control / media_discoverer.c
index 37aabf8089aac40f8b1b05e41dbd889f40e3ffd7..c4163b3d586f5aaa6bf428d4a47b5f4b1df5b46a 100644 (file)
@@ -118,10 +118,10 @@ static void services_discovery_item_removed( const vlc_event_t * p_event,
     libvlc_media_list_lock( p_mdis->p_mlist );
     for( i = 0; i < count; i++ )
     {
-        p_md = libvlc_media_list_item_at_index( p_mdis->p_mlist, i, NULL );
+        p_md = libvlc_media_list_item_at_index( p_mdis->p_mlist, i );
         if( p_md->p_input_item == p_item )
         {
-            _libvlc_media_list_remove_index( p_mdis->p_mlist, i, NULL );
+            _libvlc_media_list_remove_index( p_mdis->p_mlist, i );
             break;
         }
     }
@@ -199,9 +199,9 @@ libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
     libvlc_event_manager_register_event_type( p_mdis->p_event_manager,
             libvlc_MediaDiscovererEnded );
 
-    p_mdis->p_sd = vlc_sd_Create( (vlc_object_t*)p_inst->p_libvlc_int );
-
-    if( !p_mdis->p_sd )
+    p_mdis->p_sd = vlc_sd_Create( (vlc_object_t*)p_inst->p_libvlc_int,
+                                  psz_name );
+    if( unlikely(p_mdis->p_sd == NULL) )
     {
         libvlc_printerr( "%s: no such discovery module found", psz_name );
         libvlc_media_list_release( p_mdis->p_mlist );
@@ -228,9 +228,10 @@ libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
                       p_mdis );
 
     /* Here we go */
-    if( !vlc_sd_Start( p_mdis->p_sd, psz_name ) )
+    if( !vlc_sd_Start( p_mdis->p_sd ) )
     {
-        libvlc_printerr( "%s: internal module error", psz_name );
+        libvlc_printerr( "%s: internal module error",
+                         p_mdis->p_sd->psz_name );
         libvlc_media_list_release( p_mdis->p_mlist );
         libvlc_event_manager_release( p_mdis->p_event_manager );
         free( p_mdis );