Commit 156b3058 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

playlist: remove unused return value from playlist_Control()

parent 6efc10f0
......@@ -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.
*/
......
......@@ -30,11 +30,6 @@
#include "playlist_internal.h"
#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 );
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment