control/media_discoverer.c: Publish media_discoverer_is_running().
authorPierre d'Herbemont <pdherbemont@videolan.org>
Tue, 25 Dec 2007 22:51:13 +0000 (22:51 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Tue, 25 Dec 2007 22:51:13 +0000 (22:51 +0000)
include/vlc/libvlc.h
src/control/libvlc_internal.h
src/control/media_discoverer.c

index ab96451..14eecf1 100644 (file)
@@ -1051,6 +1051,9 @@ VLC_PUBLIC_API libvlc_media_list_t * libvlc_media_discoverer_media_list( libvlc_
 VLC_PUBLIC_API libvlc_event_manager_t *
         libvlc_media_discoverer_event_manager( libvlc_media_discoverer_t * p_mdis );
 
+VLC_PUBLIC_API int
+        libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis );
+
 /**@} */
 
 /*****************************************************************************
index ccb8751..350e3e3 100644 (file)
@@ -209,6 +209,7 @@ struct libvlc_media_discoverer_t
     libvlc_instance_t *      p_libvlc_instance;
     services_discovery_t *   p_sd;
     libvlc_media_list_t *    p_mlist;
+    vlc_bool_t               running;
 };
 
 /*
index 5e399ce..cb2b158 100644 (file)
@@ -84,6 +84,7 @@ static void services_discovery_started( const vlc_event_t * p_event,
 {
     libvlc_media_discoverer_t * p_mdis = user_data;
     libvlc_event_t event;
+    p_mdis->running = VLC_TRUE;
     event.type = libvlc_MediaDiscovererStarted;
     libvlc_event_send( p_mdis->p_event_manager, &event );
 }
@@ -97,6 +98,7 @@ static void services_discovery_ended( const vlc_event_t * p_event,
 {
     libvlc_media_discoverer_t * p_mdis = user_data;
     libvlc_event_t event;
+    p_mdis->running = VLC_FALSE;
     event.type = libvlc_MediaDiscovererEnded;
     libvlc_event_send( p_mdis->p_event_manager, &event );
 }
@@ -126,6 +128,7 @@ libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
 
     p_mdis->p_libvlc_instance = p_inst;
     p_mdis->p_mlist = libvlc_media_list_new( p_inst, NULL );
+    p_mdis->running = VLC_FALSE;
 
     p_mdis->p_event_manager = libvlc_event_manager_new( p_mdis,
             p_inst, NULL );
@@ -207,3 +210,13 @@ libvlc_media_discoverer_event_manager( libvlc_media_discoverer_t * p_mdis )
     return p_mdis->p_event_manager;
 }
 
+
+/**************************************************************************
+ * running (Public)
+ **************************************************************************/
+int
+libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis )
+{
+    return p_mdis->running;
+}
+