[vlc-devel] commit: Removed unused field and clean up (playlist). (Laurent Aimar )

git version control git at videolan.org
Mon Feb 16 22:46:44 CET 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon Feb 16 22:46:16 2009 +0100| [3fae03b32f4d08daac07f1d4059b7f79da3585d1] | committer: Laurent Aimar 

Removed unused field and clean up (playlist).

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

 include/vlc_playlist.h |    5 ++---
 src/playlist/item.c    |   34 +++++++++++++---------------------
 2 files changed, 15 insertions(+), 24 deletions(-)

diff --git a/include/vlc_playlist.h b/include/vlc_playlist.h
index ea02b7a..fc2b808 100644
--- a/include/vlc_playlist.h
+++ b/include/vlc_playlist.h
@@ -188,9 +188,8 @@ struct playlist_t
 /** Helper to add an item */
 struct playlist_add_t
 {
-    int i_node;
-    int i_item;
-    int i_position;
+    int i_node; /**< Playist id of the parent node */
+    int i_item; /**< Playist id of the playlist_item_t */
 };
 
 enum
diff --git a/src/playlist/item.c b/src/playlist/item.c
index 6cee468..5e3463c 100644
--- a/src/playlist/item.c
+++ b/src/playlist/item.c
@@ -775,22 +775,21 @@ int playlist_TreeMove( playlist_t * p_playlist, playlist_item_t *p_item,
 void playlist_SendAddNotify( playlist_t *p_playlist, int i_item_id,
                              int i_node_id, bool b_signal )
 {
-    vlc_value_t val;
+    playlist_private_t *p_sys = pl_priv(p_playlist);
     PL_ASSERT_LOCKED;
 
-    playlist_add_t *p_add = (playlist_add_t *)malloc( sizeof( playlist_add_t) );
-    if( !p_add )
-        return;
-
-    p_add->i_item = i_item_id;
-    p_add->i_node = i_node_id;
-    val.p_address = p_add;
-    pl_priv(p_playlist)->b_reset_currently_playing = true;
+    p_sys->b_reset_currently_playing = true;
     if( b_signal )
-        vlc_cond_signal( &pl_priv(p_playlist)->signal );
+        vlc_cond_signal( &p_sys->signal );
+
+    playlist_add_t add;
+    add.i_item = i_item_id;
+    add.i_node = i_node_id;
+
+    vlc_value_t val;
+    val.p_address = &add;
 
     var_Set( p_playlist, "playlist-item-append", val );
-    free( p_add );
 }
 
 /***************************************************************************
@@ -900,17 +899,10 @@ static int DeleteInner( playlist_t * p_playlist, playlist_item_t *p_item,
         ARRAY_REMOVE( p_playlist->items, i );
 
     /* Check if it is the current item */
-    if( get_current_status_item( p_playlist ) == p_item )
+    if( get_current_status_item( p_playlist ) == p_item && b_stop )
     {
-        /* Hack we don't call playlist_Control for lock reasons */
-        if( b_stop )
-        {
-            pl_priv(p_playlist)->request.i_status = PLAYLIST_STOPPED;
-            pl_priv(p_playlist)->request.b_request = true;
-            pl_priv(p_playlist)->request.p_item = NULL;
-            msg_Info( p_playlist, "stopping playback" );
-            vlc_cond_signal( &pl_priv(p_playlist)->signal );
-        }
+        playlist_Control( p_playlist, PLAYLIST_STOP, pl_Locked );
+        msg_Info( p_playlist, "stopping playback" );
     }
 
     PL_DEBUG( "deleting item `%s'", p_item->p_input->psz_name );




More information about the vlc-devel mailing list