From dccd947213dd8a81511557eaa3dce0602500113a Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sun, 20 Dec 2009 01:27:07 +0200 Subject: [PATCH] vlc_sd_GetNames: add object parameter --- 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 d647b61543..f6eaa0e77a 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 f3d62dd56f..031accd018 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 17de1f2fa7..61f6ab74b9 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 5bb55b4b70..cc43536a4b 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 491b682ae4..de161e40a9 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 1aa8f64e68..53a314be44 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 ); -- 2.39.2