[vlc-devel] [PATCH] GSoC: lua services discovery, final?

Pierre d'Herbemont pdherbemont at gmail.com
Thu Feb 4 01:39:15 CET 2010


I am fine with the patches! ;)

A few questions though:
On 2/3/10 11:50 PM, Fabio Ritrovato wrote:
> +                input_item_node_t *p_input_node = input_item_node_Create( *pp_node );
> +                input_item_t *p_input = input_item_New( p_sd,
> +                                                        strdup( lua_tostring( L, -1 ) ),
> +                                                        strdup( lua_tostring( L, -1 ) ) );
> +                lua_pop( L, 1 );
> +                vlclua_read_meta_data( p_sd, L, p_input );
> +                /* This one is to be tested... */
> +                vlclua_read_custom_meta_data( p_sd, L, p_input );
> +                lua_getfield( L, -1, "duration" );
> +                if( lua_isnumber( L, -1 ) )
> +                    input_item_SetDuration( p_input, (lua_tonumber( L, -1 )*1e6) );
> +                else if( !lua_isnil( L, -1 ) )
> +                    msg_Warn( p_sd, "Item duration should be a number (in seconds)." );
> +                lua_pop( L, 1 );
> +                input_item_node_AppendItem( p_input_node, p_input );
> +                input_item_node_PostAndDelete( p_input_node );
> +                input_item_t **udata = (input_item_t **)
> +                                       lua_newuserdata( L, sizeof( input_item_t * ) );
Why don't you use the simpler input_item_AddSubitem()? (It's doing 
basically the same thing in the backend, but it seems it should save 
some code) I am probably missing something though. Anyway, not a big deal.

Pierre.



More information about the vlc-devel mailing list