[vlc-devel] [PATCH 3/4] lua sd: make full VLC api available to the descriptor function

Rafaël Carré funman at videolan.org
Thu Nov 14 20:07:53 CET 2013


---
 modules/lua/vlc.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/modules/lua/vlc.c b/modules/lua/vlc.c
index 32bf717..db2adad 100644
--- a/modules/lua/vlc.c
+++ b/modules/lua/vlc.c
@@ -41,6 +41,7 @@
 #include <vlc_stream.h>
 
 #include "vlc.h"
+#include "libs.h"
 
 /*****************************************************************************
  * Module descriptor
@@ -658,7 +659,21 @@ static int vlc_sd_probe_Open( vlc_object_t *obj )
                 free( psz_filename );
                 goto error;
             }
+            vlclua_set_this( L, obj);
             luaL_openlibs( L );
+            static const luaL_Reg p_reg[] = { { NULL, NULL } };
+            luaL_register( L, "vlc", p_reg );
+            luaopen_input( L );
+            luaopen_msg( L );
+            luaopen_object( L );
+            luaopen_sd( L );
+            luaopen_strings( L );
+            luaopen_variables( L );
+            luaopen_stream( L );
+            luaopen_gettext( L );
+            luaopen_xml( L );
+            lua_pop( L, 1 );
+
             if( vlclua_add_modules_path( L, psz_filename ) )
             {
                 msg_Err( probe, "Error while setting the module search path for %s",
-- 
1.8.3.2




More information about the vlc-devel mailing list