[vlc-devel] commit: vlc_sd_GetNames: add object parameter ( Rémi Denis-Courmont )

git version control git at videolan.org
Mon Dec 21 20:46:03 CET 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Dec 20 01:27:07 2009 +0200| [dccd947213dd8a81511557eaa3dce0602500113a] | committer: Rémi Denis-Courmont 

vlc_sd_GetNames: add object parameter

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

 include/vlc_services_discovery.h                 |    4 +++-
 modules/gui/macosx/playlist.m                    |    2 +-
 modules/gui/qt4/components/playlist/selector.cpp |    2 +-
 modules/gui/qt4/menus.cpp                        |    2 +-
 modules/misc/lua/libs/sd.c                       |    4 +++-
 src/playlist/services_discovery.c                |    4 +++-
 6 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/include/vlc_services_discovery.h b/include/vlc_services_discovery.h
index d647b61..f6eaa0e 100644
--- a/include/vlc_services_discovery.h
+++ b/include/vlc_services_discovery.h
@@ -56,7 +56,9 @@ struct services_discovery_t
 
 /* Get the services discovery modules names to use in Create(), in a null
  * terminated string array. Array and string must be freed after use. */
-VLC_EXPORT( char **, vlc_sd_GetNames, ( char ***pppsz_longnames ) );
+VLC_EXPORT( char **, vlc_sd_GetNames, ( vlc_object_t *, char *** ) );
+#define vlc_sd_GetNames(obj, pln) \
+        vlc_sd_GetNames(VLC_OBJECT(obj), pln)
 
 /* Creation of a service_discovery object */
 VLC_EXPORT( services_discovery_t *, vlc_sd_Create, ( vlc_object_t * ) );
diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m
index f3d62dd..031accd 100644
--- a/modules/gui/macosx/playlist.m
+++ b/modules/gui/macosx/playlist.m
@@ -419,7 +419,7 @@
     o_tc_sortColumn = nil;
 
     char ** ppsz_name;
-    char ** ppsz_services = vlc_sd_GetNames( &ppsz_name );
+    char ** ppsz_services = vlc_sd_GetNames( VLCIntf, &ppsz_name );
     if( !ppsz_services )
     {
         pl_Release( VLCIntf );
diff --git a/modules/gui/qt4/components/playlist/selector.cpp b/modules/gui/qt4/components/playlist/selector.cpp
index 17de1f2..61f6ab7 100644
--- a/modules/gui/qt4/components/playlist/selector.cpp
+++ b/modules/gui/qt4/components/playlist/selector.cpp
@@ -255,7 +255,7 @@ void PLSelector::createItems()
     msrc->setExpanded( true );
 
     char **ppsz_longnames;
-    char **ppsz_names = vlc_sd_GetNames( &ppsz_longnames );
+    char **ppsz_names = vlc_sd_GetNames( THEPL, &ppsz_longnames );
     if( !ppsz_names )
         return;
 
diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
index 5bb55b4..cc43536 100644
--- a/modules/gui/qt4/menus.cpp
+++ b/modules/gui/qt4/menus.cpp
@@ -660,7 +660,7 @@ QMenu *QVLCMenu::SDMenu( intf_thread_t *p_intf, QWidget *parent )
     menu->setTitle( qtr( I_PL_SD ) );
 
     char **ppsz_longnames;
-    char **ppsz_names = vlc_sd_GetNames( &ppsz_longnames );
+    char **ppsz_names = vlc_sd_GetNames( p_intf, &ppsz_longnames );
     if( !ppsz_names )
         return menu;
 
diff --git a/modules/misc/lua/libs/sd.c b/modules/misc/lua/libs/sd.c
index 491b682..de161e4 100644
--- a/modules/misc/lua/libs/sd.c
+++ b/modules/misc/lua/libs/sd.c
@@ -49,8 +49,10 @@
  *****************************************************************************/
 static int vlclua_sd_get_services_names( lua_State *L )
 {
+    playlist_t *p_playlist = vlclua_get_playlist_internal( L );
     char **ppsz_longnames;
-    char **ppsz_names = vlc_sd_GetNames( &ppsz_longnames );
+    char **ppsz_names = vlc_sd_GetNames( p_playlist, &ppsz_longnames );
+    vlclua_release_playlist_internal( p_playlist );
     if( !ppsz_names )
         return 0;
 
diff --git a/src/playlist/services_discovery.c b/src/playlist/services_discovery.c
index 1aa8f64..53a314b 100644
--- a/src/playlist/services_discovery.c
+++ b/src/playlist/services_discovery.c
@@ -50,10 +50,12 @@ static void services_discovery_Destructor ( vlc_object_t *p_obj );
  * That's how the playlist get's Service Discovery information
  */
 
+#undef vlc_sd_GetNames
+
 /**
  * Gets the list of available services discovery plugins.
  */
-char **vlc_sd_GetNames( char ***pppsz_longnames )
+char **vlc_sd_GetNames( vlc_object_t *obj, char ***pppsz_longnames )
 {
     return module_GetModulesNamesForCapability( "services_discovery",
                                                 pppsz_longnames );




More information about the vlc-devel mailing list