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

Rémi Denis-Courmont remi at remlab.net
Fri Nov 15 08:41:26 CET 2013


On Thu, 14 Nov 2013 20:07:53 +0100, Rafaël Carré <funman at videolan.org>
wrote:
> ---
>  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 );

I fail to see why a descriptor would or should control an input.

> +            luaopen_msg( L );

Ok.

> +            luaopen_object( L );

Ok but probably useless.

> +            luaopen_sd( L );

Nonsensical.

> +            luaopen_strings( L );

Ok.

> +            luaopen_variables( L );

Same as object.

> +            luaopen_stream( L );

Wrong due to blocking API (and same would go for net).

> +            luaopen_gettext( L );

Not needed unless native code is buggy.

> +            luaopen_xml( L );

Ok.

> +            lua_pop( L, 1 );
> +
>              if( vlclua_add_modules_path( L, psz_filename ) )
>              {
>                  msg_Err( probe, "Error while setting the module search
>                  path for %s",

-- 
Rémi Denis-Courmont
Sent from my collocated server



More information about the vlc-devel mailing list