ncurses: lock playlist in open box
authorRafaël Carré <rafael.carre@gmail.com>
Mon, 3 Aug 2009 19:59:25 +0000 (21:59 +0200)
committerRafaël Carré <rafael.carre@gmail.com>
Mon, 3 Aug 2009 19:59:25 +0000 (21:59 +0200)
modules/gui/ncurses.c

index 0421a5c..8bf7d8f 100644 (file)
@@ -954,6 +954,7 @@ static int HandleKey( intf_thread_t *p_intf, int i_key )
                 {
                     playlist_item_t *p_parent = p_sys->p_node;
 
+                    PL_LOCK;
                     if( !p_parent )
                     p_parent = playlist_CurrentPlayingItem(p_playlist) ? playlist_CurrentPlayingItem(p_playlist)->p_parent : NULL;
                     if( !p_parent )
@@ -961,6 +962,7 @@ static int HandleKey( intf_thread_t *p_intf, int i_key )
 
                     while( p_parent->p_parent && p_parent->p_parent->p_parent )
                         p_parent = p_parent->p_parent;
+                    PL_UNLOCK;
 
                     playlist_Add( p_playlist, p_sys->psz_open_chain, NULL,
                                   PLAYLIST_APPEND|PLAYLIST_GO, PLAYLIST_END,