[vlc-commits] playlist: remove unused return value from playlist_Control()

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 17:41:16 2014 +0200| [156b305884ea57e5d5bc7f96ebe13466f845149a] | committer: Rémi Denis-Courmont

playlist: remove unused return value from playlist_Control()

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

 include/vlc_playlist.h |    3 +--
 src/playlist/control.c |   49 ++++++++++++++++++------------------------------
 2 files changed, 19 insertions(+), 33 deletions(-)

diff --git a/include/vlc_playlist.h b/include/vlc_playlist.h
index 947ac99..ea0d05c 100644
--- a/include/vlc_playlist.h
+++ b/include/vlc_playlist.h
@@ -283,9 +283,8 @@ VLC_API void playlist_Deactivate( playlist_t * );
  * \param i_query the command to do
  * \param b_locked TRUE if playlist is locked when entering this function
  * \param variable number of arguments
- * \return VLC_SUCCESS or an error
  */
-VLC_API int playlist_Control( playlist_t *p_playlist, int i_query, bool b_locked, ...  );
+VLC_API void playlist_Control( playlist_t *p_playlist, int i_query, bool b_locked, ...  );
 
 /** Get current playing input. The object is retained.
  */
diff --git a/src/playlist/control.c b/src/playlist/control.c
index e1be944..b475d22 100644
--- a/src/playlist/control.c
+++ b/src/playlist/control.c
@@ -31,11 +31,6 @@
 #include <assert.h>
 
 /*****************************************************************************
- * Local prototypes
- *****************************************************************************/
-static int PlaylistVAControl( playlist_t * p_playlist, int i_query, va_list args );
-
-/*****************************************************************************
  * Playlist control
  *****************************************************************************/
 
@@ -54,29 +49,13 @@ void playlist_AssertLocked( playlist_t *pl )
     vlc_assert_locked( &pl_priv(pl)->lock );
 }
 
-int playlist_Control( playlist_t * p_playlist, int i_query,
-                      bool b_locked, ... )
-{
-    va_list args;
-    int i_result;
-    PL_LOCK_IF( !b_locked );
-    va_start( args, b_locked );
-    i_result = PlaylistVAControl( p_playlist, i_query, args );
-    va_end( args );
-    PL_UNLOCK_IF( !b_locked );
-
-    return i_result;
-}
-
-static int PlaylistVAControl( playlist_t * p_playlist, int i_query, va_list args )
+static void playlist_vaControl( playlist_t *p_playlist, int i_query, va_list args )
 {
-    playlist_item_t *p_item, *p_node;
-
     PL_ASSERT_LOCKED;
 
     if( i_query != PLAYLIST_STOP )
         if( pl_priv(p_playlist)->killed || playlist_IsEmpty( p_playlist ) )
-            return VLC_EGENERIC;
+            return;
 
     switch( i_query )
     {
@@ -89,8 +68,10 @@ static int PlaylistVAControl( playlist_t * p_playlist, int i_query, va_list args
     // Node can be null, it will keep the same. Use with care ...
     // Item null = take the first child of node
     case PLAYLIST_VIEWPLAY:
-        p_node = (playlist_item_t *)va_arg( args, playlist_item_t * );
-        p_item = (playlist_item_t *)va_arg( args, playlist_item_t * );
+    {
+        playlist_item_t *p_node = va_arg( args, playlist_item_t * );
+        playlist_item_t *p_item = va_arg( args, playlist_item_t * );
+
         if ( p_node == NULL )
         {
             p_node = get_current_status_node( p_playlist );
@@ -104,6 +85,7 @@ static int PlaylistVAControl( playlist_t * p_playlist, int i_query, va_list args
         if( p_item && var_GetBool( p_playlist, "random" ) )
             pl_priv(p_playlist)->b_reset_currently_playing = true;
         break;
+    }
 
     case PLAYLIST_PLAY:
         if( pl_priv(p_playlist)->p_input )
@@ -127,7 +109,7 @@ static int PlaylistVAControl( playlist_t * p_playlist, int i_query, va_list args
         {   /* FIXME: is this really useful without input? */
             pl_priv(p_playlist)->status.i_status = PLAYLIST_PAUSED;
             /* return without notifying the playlist thread as there is nothing to do */
-            return VLC_SUCCESS;
+            return;
         }
 
         if( var_GetInteger( pl_priv(p_playlist)->p_input, "state" ) == PAUSE_S )
@@ -151,12 +133,17 @@ static int PlaylistVAControl( playlist_t * p_playlist, int i_query, va_list args
             pl_priv(p_playlist)->request.i_status = pl_priv(p_playlist)->status.i_status;
         pl_priv(p_playlist)->request.b_request = true;
         break;
-
-    default:
-        msg_Err( p_playlist, "unknown playlist query" );
-        return VLC_EBADVAR;
     }
     vlc_cond_signal( &pl_priv(p_playlist)->signal );
+}
 
-    return VLC_SUCCESS;
+void playlist_Control( playlist_t *p_playlist, int query, bool locked, ... )
+{
+    va_list args;
+
+    PL_LOCK_IF( !locked );
+    va_start( args, locked );
+    playlist_vaControl( p_playlist, query, args );
+    va_end( args );
+    PL_UNLOCK_IF( !locked );
 }



More information about the vlc-commits mailing list