From 22a9f08b646ae7262e4cd3699ef02f548ffc2f8b Mon Sep 17 00:00:00 2001 From: Jakob Leben Date: Fri, 5 Feb 2010 14:17:12 +0100 Subject: [PATCH] lua: vlclua_playlist_add_internal() should post an input item tree --- modules/misc/lua/vlc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/misc/lua/vlc.c b/modules/misc/lua/vlc.c index 2005e609d9..dd1cb345d0 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 { -- 2.11.4.GIT