[vlc-devel] commit: lua: vlclua_playlist_add_internal() should post an input item tree (Jakob Leben )
git version control
git at videolan.org
Fri Feb 5 15:02:06 CET 2010
vlc | branch: master | Jakob Leben <jleben at videolan.org> | Fri Feb 5 14:17:12 2010 +0100| [22a9f08b646ae7262e4cd3699ef02f548ffc2f8b] | committer: Jakob Leben
lua: vlclua_playlist_add_internal() should post an input item tree
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=22a9f08b646ae7262e4cd3699ef02f548ffc2f8b
---
modules/misc/lua/vlc.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/modules/misc/lua/vlc.c b/modules/misc/lua/vlc.c
index 2005e60..dd1cb34 100644
--- a/modules/misc/lua/vlc.c
+++ b/modules/misc/lua/vlc.c
@@ -392,12 +392,14 @@ int __vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
input_item_t *p_parent, bool b_play )
{
int i_count = 0;
+ input_item_node_t *p_parent_node = NULL;
assert( p_parent || p_playlist );
/* playlist */
if( lua_istable( L, -1 ) )
{
+ if( p_parent ) p_parent_node = input_item_node_Create( p_parent );
lua_pushnil( L );
/* playlist nil */
while( lua_next( L, -2 ) )
@@ -472,7 +474,7 @@ int __vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
/* Append item to playlist */
if( p_parent ) /* Add to node */
{
- input_item_PostSubItem( p_parent, p_input );
+ input_item_node_AppendItem( p_parent_node, p_input );
}
else /* Play or Enqueue (preparse) */
/* FIXME: playlist_AddInput() can fail */
@@ -504,6 +506,11 @@ int __vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
/* playlist key */
}
/* playlist */
+ if( p_parent )
+ {
+ if( i_count ) input_item_node_PostAndDelete( p_parent_node );
+ else input_item_node_Delete( p_parent_node );
+ }
}
else
{
More information about the vlc-devel
mailing list