[vlc-devel] commit: lua: Add freebox and frenchtv back in the builtin SD. (Pierre d' Herbemont )
git version control
git at videolan.org
Mon Feb 15 16:56:33 CET 2010
vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Mon Feb 15 16:55:11 2010 +0100| [05b625bca255512ea9b246c2752d217ba4be0404] | committer: Pierre d'Herbemont
lua: Add freebox and frenchtv back in the builtin SD.
You can now load them with --services-discovery=freebox,frenchtv.
However non registered lua sd will still require --lua-sd=<name>.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=05b625bca255512ea9b246c2752d217ba4be0404
---
modules/misc/lua/services_discovery.c | 18 +++++++++++++++---
modules/misc/lua/vlc.c | 12 ++++++++++++
2 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/modules/misc/lua/services_discovery.c b/modules/misc/lua/services_discovery.c
index 65ca90e..972336a 100644
--- a/modules/misc/lua/services_discovery.c
+++ b/modules/misc/lua/services_discovery.c
@@ -57,10 +57,22 @@ 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;
- char *psz_name = NULL;
+ char *psz_name = strdup(p_sd->psz_name);
+
+ if( !strcmp(p_sd->psz_name, "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 );
+ psz_name = var_CreateGetString( p_sd, "lua-sd" );
+ }
+ else
+ {
+ // We are loading a builtin lua sd module.
+ psz_name = strdup(p_sd->psz_name);
+ }
- config_ChainParse( p_sd, "lua-", ppsz_sd_options, p_sd->p_cfg );
- psz_name = var_CreateGetString( p_sd, "lua-sd" );
if( !( p_sys = malloc( sizeof( services_discovery_sys_t ) ) ) )
return VLC_ENOMEM;
p_sd->p_sys = p_sys;
diff --git a/modules/misc/lua/vlc.c b/modules/misc/lua/vlc.c
index 017eabf..9084739 100644
--- a/modules/misc/lua/vlc.c
+++ b/modules/misc/lua/vlc.c
@@ -124,6 +124,18 @@ vlc_module_begin ()
add_string( "lua-sd", "", NULL, "", "", false )
set_callbacks( Open_LuaSD, Close_LuaSD )
+ add_submodule ()
+ set_description( N_("Freebox TV") )
+ add_shortcut( "freebox" )
+ set_capability( "services_discovery", 0 )
+ set_callbacks( Open_LuaSD, Close_LuaSD )
+
+ add_submodule ()
+ set_description( N_("French TV") )
+ add_shortcut( "frenchtv" )
+ set_capability( "services_discovery", 0 )
+ set_callbacks( Open_LuaSD, Close_LuaSD )
+
VLC_SD_PROBE_SUBMODULE
vlc_module_end ()
More information about the vlc-devel
mailing list