]> git.sesse.net Git - vlc/commitdiff
lua: Add freebox and frenchtv back in the builtin SD.
authorPierre d'Herbemont <pdherbemont@free.fr>
Mon, 15 Feb 2010 15:55:11 +0000 (16:55 +0100)
committerPierre d'Herbemont <pdherbemont@free.fr>
Mon, 15 Feb 2010 15:55:11 +0000 (16:55 +0100)
You can now load them with --services-discovery=freebox,frenchtv.
However non registered lua sd will still require --lua-sd=<name>.

modules/misc/lua/services_discovery.c
modules/misc/lua/vlc.c

index 65ca90e6d813a9d667785f36aa4188098df05470..972336a1664a83d1fd9a69ecc51a37d337d705f4 100644 (file)
@@ -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;
index 017eabfdd6162f19a5adadd2edd0a1fd4e29d9e8..9084739a37d31ba2f8830c38d1bd44bda4aa95ee 100644 (file)
@@ -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 ()