[vlc-devel] commit: Don't restart playlist after converting current item to node ( Przemyslaw Fiala )

git version control git at videolan.org
Wed Aug 20 02:01:19 CEST 2008


vlc | branch: master | Przemyslaw Fiala <bl4 at playker.info> | Tue Aug 19 21:47:57 2008 +0200| [4f5acdf3dd937dd79ca6b51780cdb4db6bb8f7a1] | committer: Pierre d'Herbemont 

Don't restart playlist after converting current item to node

Signed-off-by: Pierre d'Herbemont <pdherbemont at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4f5acdf3dd937dd79ca6b51780cdb4db6bb8f7a1
---

 src/playlist/item.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/src/playlist/item.c b/src/playlist/item.c
index d982632..70924e4 100644
--- a/src/playlist/item.c
+++ b/src/playlist/item.c
@@ -609,6 +609,26 @@ playlist_item_t *playlist_ItemToNode( playlist_t *p_playlist,
             ChangeToNode( p_playlist, p_item_in_one );
         else
         {
+            playlist_item_t *p_status_item = get_current_status_item( p_playlist );
+            playlist_item_t *p_status_node = get_current_status_node( p_playlist );
+            if( p_item_in_one == p_status_item )
+            {
+                /* We're deleting the current playlist item. Update
+                 * the playlist object to point at the previous item
+                 * so the playlist won't be restarted */
+                playlist_item_t *p_prev_status_item = NULL;
+                int i = 0;
+                while( i < p_status_node->i_children &&
+                       p_status_node->pp_children[i] != p_status_item )
+                {
+                    p_prev_status_item = p_status_node->pp_children[i];
+                    i++;
+                }
+                if( i == p_status_node->i_children )
+                    p_prev_status_item = NULL;
+                if( p_prev_status_item )
+                    set_current_status_item( p_playlist, p_prev_status_item );
+            }
             DeleteFromInput( p_playlist, p_item_in_one->p_input->i_id,
                              p_playlist->p_root_onelevel, false );
         }




More information about the vlc-devel mailing list