]> git.sesse.net Git - vlc/blobdiff - modules/misc/lua/services_discovery.c
lua: Add freebox and frenchtv back in the builtin SD.
[vlc] / modules / misc / lua / services_discovery.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;