lib: media_discoverer: stop after sending events
authorThomas Guillem <thomas@gllm.fr>
Mon, 13 Jun 2016 11:23:47 +0000 (13:23 +0200)
committerThomas Guillem <thomas@gllm.fr>
Mon, 13 Jun 2016 11:25:00 +0000 (13:25 +0200)
lib/media_discoverer.c

index 93295fd..d637189 100644 (file)
@@ -234,8 +234,6 @@ libvlc_media_discoverer_start( libvlc_media_discoverer_t * p_mdis )
 LIBVLC_API void
 libvlc_media_discoverer_stop( libvlc_media_discoverer_t * p_mdis )
 {
-    vlc_sd_Stop( p_mdis->p_sd );
-
     p_mdis->running = false;
 
     libvlc_media_list_t * p_mlist = p_mdis->p_mlist;
@@ -246,6 +244,8 @@ libvlc_media_discoverer_stop( libvlc_media_discoverer_t * p_mdis )
     libvlc_event_t event;
     event.type = libvlc_MediaDiscovererEnded;
     libvlc_event_send( p_mdis->p_event_manager, &event );
+
+    vlc_sd_Stop( p_mdis->p_sd );
 }
 
 /**************************************************************************