[vlc-commits] lib: fix libvlc_media_discoverer_localized_name

Thomas Guillem git at videolan.org
Fri Jun 10 14:39:12 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Jun 10 13:58:44 2016 +0200| [18a2dc07e60a75ca9ea7b3f3ac542807dbb24fad] | committer: Thomas Guillem

lib: fix libvlc_media_discoverer_localized_name

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=18a2dc07e60a75ca9ea7b3f3ac542807dbb24fad
---

 include/vlc/libvlc_media_discoverer.h |    2 +-
 src/playlist/services_discovery.c     |    2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/vlc/libvlc_media_discoverer.h b/include/vlc/libvlc_media_discoverer.h
index 47e53c0..6ed8746 100644
--- a/include/vlc/libvlc_media_discoverer.h
+++ b/include/vlc/libvlc_media_discoverer.h
@@ -133,7 +133,7 @@ libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis );
  * Get media service discover object its localized name.
  *
  * \param p_mdis media discover object
- * \return localized name
+ * \return localized name or NULL if the media_discoverer is not started
  */
 LIBVLC_API char *
 libvlc_media_discoverer_localized_name( libvlc_media_discoverer_t * p_mdis );
diff --git a/src/playlist/services_discovery.c b/src/playlist/services_discovery.c
index 4a5b451..b074907 100644
--- a/src/playlist/services_discovery.c
+++ b/src/playlist/services_discovery.c
@@ -199,6 +199,8 @@ static void services_discovery_Destructor ( vlc_object_t *p_obj )
 char *
 services_discovery_GetLocalizedName ( services_discovery_t * p_sd )
 {
+    if (p_sd->p_module == NULL)
+        return NULL;
     return strdup( module_get_name( p_sd->p_module, true ) );
 }
 



More information about the vlc-commits mailing list