X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fcontrol%2Fmedia_discoverer.c;h=c4163b3d586f5aaa6bf428d4a47b5f4b1df5b46a;hb=7b5b08e3c744f3f8c08b27dcc02a1c1b53ad30d1;hp=602729f4c048ac72bbfcd0352931c7f315cf62be;hpb=6c2286c22b6074320338c085d78d4a795478c1c3;p=vlc diff --git a/src/control/media_discoverer.c b/src/control/media_discoverer.c index 602729f4c0..c4163b3d58 100644 --- a/src/control/media_discoverer.c +++ b/src/control/media_discoverer.c @@ -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 );