[vlc-commits] playlist: remove request.i_status

Rémi Denis-Courmont git at videolan.org
Mon Dec 15 18:25:18 CET 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Dec 15 18:29:50 2014 +0200| [8fed9f2183147c95dbf213adb7e42ca3771cbaf0] | committer: Rémi Denis-Courmont

playlist: remove request.i_status

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

 src/playlist/control.c           |    7 +------
 src/playlist/item.c              |    1 -
 src/playlist/playlist_internal.h |    1 -
 src/playlist/thread.c            |    6 ++++--
 4 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/playlist/control.c b/src/playlist/control.c
index 0644177..521c3b6 100644
--- a/src/playlist/control.c
+++ b/src/playlist/control.c
@@ -60,9 +60,9 @@ static void playlist_vaControl( playlist_t *p_playlist, int i_query, va_list arg
     switch( i_query )
     {
     case PLAYLIST_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;
+        pl_priv(p_playlist)->request.p_node = NULL;
         break;
 
     // Node can be null, it will keep the same. Use with care ...
@@ -77,7 +77,6 @@ static void playlist_vaControl( playlist_t *p_playlist, int i_query, va_list arg
             p_node = get_current_status_node( p_playlist );
             assert( p_node );
         }
-        pl_priv(p_playlist)->request.i_status = PLAYLIST_RUNNING;
         pl_priv(p_playlist)->request.i_skip = 0;
         pl_priv(p_playlist)->request.b_request = true;
         pl_priv(p_playlist)->request.p_node = p_node;
@@ -96,7 +95,6 @@ static void playlist_vaControl( playlist_t *p_playlist, int i_query, va_list arg
         }
         else
         {
-            pl_priv(p_playlist)->request.i_status = PLAYLIST_RUNNING;
             pl_priv(p_playlist)->request.b_request = true;
             pl_priv(p_playlist)->request.p_node = get_current_status_node( p_playlist );
             pl_priv(p_playlist)->request.p_item = get_current_status_item( p_playlist );
@@ -128,9 +126,6 @@ static void playlist_vaControl( playlist_t *p_playlist, int i_query, va_list arg
         pl_priv(p_playlist)->request.p_node = get_current_status_node( p_playlist );
         pl_priv(p_playlist)->request.p_item = get_current_status_item( p_playlist );
         pl_priv(p_playlist)->request.i_skip = (int) va_arg( args, int );
-        /* if already running, keep running */
-        if( pl_priv(p_playlist)->status.i_status != PLAYLIST_STOPPED )
-            pl_priv(p_playlist)->request.i_status = pl_priv(p_playlist)->status.i_status;
         pl_priv(p_playlist)->request.b_request = true;
         break;
     }
diff --git a/src/playlist/item.c b/src/playlist/item.c
index e51637f..a05b776 100644
--- a/src/playlist/item.c
+++ b/src/playlist/item.c
@@ -756,7 +756,6 @@ static void GoAndPreparse( playlist_t *p_playlist, int i_mode,
         sys->request.p_item = p_item;
         if( sys->p_input != NULL )
             input_Stop( sys->p_input, true );
-        sys->request.i_status = PLAYLIST_RUNNING;
         vlc_cond_signal( &sys->signal );
     }
     /* Preparse if no artist/album info, and hasn't been preparsed allready
diff --git a/src/playlist/playlist_internal.h b/src/playlist/playlist_internal.h
index ee8f632..558cdfe 100644
--- a/src/playlist/playlist_internal.h
+++ b/src/playlist/playlist_internal.h
@@ -68,7 +68,6 @@ typedef struct playlist_private_t
 
     struct {
         /* Request. Use this to give orders to the playlist main loop  */
-        playlist_status_t   i_status; /**< requested playlist status */
         playlist_item_t *   p_node;   /**< requested node to play from */
         playlist_item_t *   p_item;   /**< requested item to play in the node */
 
diff --git a/src/playlist/thread.c b/src/playlist/thread.c
index 8e7b082..357d464 100644
--- a/src/playlist/thread.c
+++ b/src/playlist/thread.c
@@ -523,8 +523,10 @@ static void *Thread ( void *data )
         if( p_sys->killed )
             break; /* THE END */
 
-        const int status = p_sys->request.b_request ?
-                           p_sys->request.i_status : p_sys->status.i_status;
+        int status = p_sys->status.i_status;
+        if( p_sys->request.b_request )
+            status = (p_sys->request.p_item || p_sys->request.p_node)
+                     ? PLAYLIST_RUNNING : PLAYLIST_STOPPED;
 
         /* Destroy any video display if the playlist is supposed to stop */
         if( status == PLAYLIST_STOPPED



More information about the vlc-commits mailing list