]> git.sesse.net Git - vlc/commitdiff
sd: Export internals with a getters.
authorPierre d'Herbemont <pdherbemont@free.fr>
Wed, 24 Feb 2010 13:15:59 +0000 (14:15 +0100)
committerPierre d'Herbemont <pdherbemont@free.fr>
Wed, 24 Feb 2010 13:15:59 +0000 (14:15 +0100)
lua need them. Also fix an obvious leak.

include/vlc_services_discovery.h
modules/misc/lua/services_discovery.c
src/libvlccore.sym
src/playlist/services_discovery.c

index 0e659f0c72e7fc20c45e0eefb888f1325f8d8583..3a4e9881a62a0dd6e4a1a0749ff999ef92575f53 100644 (file)
@@ -71,6 +71,8 @@ VLC_EXPORT( services_discovery_t *, vlc_sd_Create, ( vlc_object_t *, const char
 VLC_EXPORT( bool, vlc_sd_Start, ( services_discovery_t * ) );
 VLC_EXPORT( void, vlc_sd_Stop, ( services_discovery_t * ) );
 VLC_EXPORT( void, vlc_sd_Destroy, ( services_discovery_t * ) );
+VLC_EXPORT( const char *, vlc_sd_GetName, ( services_discovery_t * ) );
+VLC_EXPORT( config_chain_t *, vlc_sd_GetConfigChain, ( services_discovery_t * ) );
 
 static inline void vlc_sd_StopAndDestroy( services_discovery_t * p_this )
 {
index f5e21fdff7f611318ad4f3246bf1c6cc45dca1d6..9df7069c3e30e3124a2cdc1058f2d982a72169da 100644 (file)
@@ -57,20 +57,21 @@ int Open_LuaSD( vlc_object_t *p_this )
     services_discovery_t *p_sd = ( services_discovery_t * )p_this;
     services_discovery_sys_t *p_sys;
     lua_State *L = NULL;
-    char *psz_name = strdup(p_sd->psz_name);
+    char *psz_name;
 
-    if( !strcmp(p_sd->psz_name, "lua"))
+
+    if( !strcmp(vlc_sd_GetName(p_sd), "lua"))
     {
         // We want to load the module name "lua"
         // This module can be used to load lua script not registered
         // as builtin lua SD modules.
-        config_ChainParse( p_sd, "lua-", ppsz_sd_options, p_sd->p_cfg );
+        config_ChainParse( p_sd, "lua-", ppsz_sd_options, vlc_sd_GetConfigChain(p_sd) );
         psz_name = var_CreateGetString( p_sd, "lua-sd" );
     }
     else
     {
         // We are loading a builtin lua sd module.
-        psz_name = strdup(p_sd->psz_name);
+        psz_name = strdup(vlc_sd_GetName(p_sd));
     }
 
     if( !( p_sys = malloc( sizeof( services_discovery_sys_t ) ) ) )
index 85da6f3eb335309497a86cfd0cfb60deb6b9dc24..6bdedcad3dd82612e7dd35aee24ae6741193d9cc 100644 (file)
@@ -563,6 +563,8 @@ vlc_rwlock_wrlock
 vlc_savecancel
 vlc_sd_Create
 vlc_sd_Destroy
+vlc_sd_GetConfigChain
+vlc_sd_GetName
 vlc_sd_GetNames
 vlc_sd_probe_Add
 vlc_sdp_Start
index c9f9aff4377c831badd7a3331e0d1b3c6f4821c8..3040d6c65862574e4665fad7ba902abf93976fda 100644 (file)
@@ -185,6 +185,20 @@ void vlc_sd_Destroy( services_discovery_t *p_sd )
     vlc_object_release( p_sd );
 }
 
+/***********************************************************************
+ * Getters
+ ***********************************************************************/
+
+const char *vlc_sd_GetName( services_discovery_t *p_sd )
+{
+    return p_sd->p->psz_name;
+}
+
+config_chain_t *vlc_sd_GetConfigChain( services_discovery_t *p_sd )
+{
+    return p_sd->p->p_cfg;
+}
+
 /***********************************************************************
  * Destructor
  ***********************************************************************/