* \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.
*/
#include "playlist_internal.h"
#include <assert.h>
-/*****************************************************************************
- * Local prototypes
- *****************************************************************************/
-static int PlaylistVAControl( playlist_t * p_playlist, int i_query, va_list args );
-
/*****************************************************************************
* Playlist control
*****************************************************************************/
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 )
{
// 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 );
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 )
{ /* 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 )
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 );
}