Commit 2c57cb80 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

libvlc media (list) player: remove a bunch of never raised exceptions

parent 6d656add
......@@ -92,14 +92,12 @@ VLC_PUBLIC_API libvlc_event_manager_t *
VLC_PUBLIC_API void
libvlc_media_list_player_set_media_player(
libvlc_media_list_player_t * p_mlp,
libvlc_media_player_t * p_mi,
libvlc_exception_t * p_e );
libvlc_media_player_t * p_mi );
VLC_PUBLIC_API void
libvlc_media_list_player_set_media_list(
libvlc_media_list_player_t * p_mlp,
libvlc_media_list_t * p_mlist,
libvlc_exception_t * p_e );
libvlc_media_list_t * p_mlist );
/**
* Play media list
......@@ -129,19 +127,16 @@ VLC_PUBLIC_API void
* \return true for playing and false for not playing
*/
VLC_PUBLIC_API int
libvlc_media_list_player_is_playing( libvlc_media_list_player_t * p_mlp,
libvlc_exception_t * p_e );
libvlc_media_list_player_is_playing( libvlc_media_list_player_t * p_mlp );
/**
* Get current libvlc_state of media list player
*
* \param p_mlp media list player instance
* \param p_e initialized exception instance
* \return libvlc_state_t for media list player
*/
VLC_PUBLIC_API libvlc_state_t
libvlc_media_list_player_get_state( libvlc_media_list_player_t * p_mlp,
libvlc_exception_t * p_e );
libvlc_media_list_player_get_state( libvlc_media_list_player_t * p_mlp );
/**
* Play media list item at position index
......@@ -166,11 +161,9 @@ VLC_PUBLIC_API void
* Stop playing media list
*
* \param p_mlp media list player instance
* \param p_e initialized exception instance
*/
VLC_PUBLIC_API void
libvlc_media_list_player_stop( libvlc_media_list_player_t * p_mlp,
libvlc_exception_t * p_e );
libvlc_media_list_player_stop( libvlc_media_list_player_t * p_mlp );
/**
* Play next item from media list
......@@ -199,13 +192,11 @@ VLC_PUBLIC_API void
*
* \param p_mlp media list player instance
* \param e_mode playback mode specification
* \param p_e initialized exception instance
*/
VLC_PUBLIC_API void
libvlc_media_list_player_set_playback_mode(
libvlc_media_list_player_t * p_mlp,
libvlc_playback_mode_t e_mode,
libvlc_exception_t * p_e );
libvlc_playback_mode_t e_mode );
/** @} media_list_player */
......
......@@ -147,37 +147,33 @@ VLC_PUBLIC_API void libvlc_media_player_retain( libvlc_media_player_t * );
* \param p_mi the Media Player
* \param p_md the Media. Afterwards the p_md can be safely
* destroyed.
* \param p_e an initialized exception pointer
*/
VLC_PUBLIC_API void libvlc_media_player_set_media( libvlc_media_player_t *, libvlc_media_t *, libvlc_exception_t * );
VLC_PUBLIC_API void libvlc_media_player_set_media( libvlc_media_player_t *, libvlc_media_t * );
/**
* Get the media used by the media_player.
*
* \param p_mi the Media Player
* \param p_e an initialized exception pointer
* \return the media associated with p_mi, or NULL if no
* media is associated
*/
VLC_PUBLIC_API libvlc_media_t * libvlc_media_player_get_media( libvlc_media_player_t *, libvlc_exception_t * );
VLC_PUBLIC_API libvlc_media_t * libvlc_media_player_get_media( libvlc_media_player_t * );
/**
* Get the Event Manager from which the media player send event.
*
* \param p_mi the Media Player
* \param p_e an initialized exception pointer
* \return the event manager associated with p_mi
*/
VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_media_player_t *, libvlc_exception_t * );
VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_media_player_t * );
/**
* is_playing
*
* \param p_mi the Media Player
* \param p_e an initialized exception pointer
* \return 1 if the media player is playing, 0 otherwise
*/
VLC_PUBLIC_API int libvlc_media_player_is_playing ( libvlc_media_player_t *, libvlc_exception_t * );
VLC_PUBLIC_API int libvlc_media_player_is_playing ( libvlc_media_player_t * );
/**
* Play
......@@ -201,7 +197,7 @@ VLC_PUBLIC_API void libvlc_media_player_pause ( libvlc_media_player_t *, libvlc_
* \param p_mi the Media Player
* \param p_e an initialized exception pointer
*/
VLC_PUBLIC_API void libvlc_media_player_stop ( libvlc_media_player_t *, libvlc_exception_t * );
VLC_PUBLIC_API void libvlc_media_player_stop ( libvlc_media_player_t * );
/**
* Set the NSView handler where the media player should render its video output.
......@@ -218,9 +214,8 @@ VLC_PUBLIC_API void libvlc_media_player_stop ( libvlc_media_player_t *, libvlc_e
*
* \param p_mi the Media Player
* \param drawable the NSView handler
* \param p_e an initialized exception pointer
*/
VLC_PUBLIC_API void libvlc_media_player_set_nsobject ( libvlc_media_player_t *p_mi, void * drawable, libvlc_exception_t *p_e );
VLC_PUBLIC_API void libvlc_media_player_set_nsobject ( libvlc_media_player_t *p_mi, void * drawable );
/**
* Get the NSView handler previously set with libvlc_media_player_set_nsobject().
......@@ -237,7 +232,7 @@ VLC_PUBLIC_API void * libvlc_media_player_get_nsobject ( libvlc_media_player_t *
* \param drawable the agl handler
* \param p_e an initialized exception pointer
*/
VLC_PUBLIC_API void libvlc_media_player_set_agl ( libvlc_media_player_t *p_mi, uint32_t drawable, libvlc_exception_t *p_e );
VLC_PUBLIC_API void libvlc_media_player_set_agl ( libvlc_media_player_t *p_mi, uint32_t drawable );
/**
* Get the agl handler previously set with libvlc_media_player_set_agl().
......@@ -262,9 +257,8 @@ VLC_PUBLIC_API uint32_t libvlc_media_player_get_agl ( libvlc_media_player_t *p_m
*
* \param p_mi the Media Player
* \param drawable the ID of the X window
* \param p_e an initialized exception pointer
*/
VLC_PUBLIC_API void libvlc_media_player_set_xwindow ( libvlc_media_player_t *p_mi, uint32_t drawable, libvlc_exception_t *p_e );
VLC_PUBLIC_API void libvlc_media_player_set_xwindow ( libvlc_media_player_t *p_mi, uint32_t drawable );
/**
* Get the X Window System window identifier previously set with
......@@ -284,9 +278,8 @@ VLC_PUBLIC_API uint32_t libvlc_media_player_get_xwindow ( libvlc_media_player_t
*
* \param p_mi the Media Player
* \param drawable windows handle of the drawable
* \param p_e an initialized exception pointer
*/
VLC_PUBLIC_API void libvlc_media_player_set_hwnd ( libvlc_media_player_t *p_mi, void *drawable, libvlc_exception_t *p_e );
VLC_PUBLIC_API void libvlc_media_player_set_hwnd ( libvlc_media_player_t *p_mi, void *drawable );
/**
* Get the Windows API window handle (HWND) previously set with
......@@ -460,9 +453,8 @@ VLC_PUBLIC_API void libvlc_media_player_set_rate( libvlc_media_player_t *, float
*
* \param p_mi the Media Player
* \param p_e an initialized exception pointer
* \return current movie state as libvlc_state_t
*/
VLC_PUBLIC_API libvlc_state_t libvlc_media_player_get_state( libvlc_media_player_t *, libvlc_exception_t *);
VLC_PUBLIC_API libvlc_state_t libvlc_media_player_get_state( libvlc_media_player_t *);
/**
* Get movie fps rate
......
......@@ -84,7 +84,7 @@ static void set_relative_playlist_position_and_play(
libvlc_media_list_player_t * p_mlp,
int i_relative_position,
libvlc_exception_t * p_e);
static void stop(libvlc_media_list_player_t * p_mlp, libvlc_exception_t * p_e);
static void stop(libvlc_media_list_player_t * p_mlp);
/*
* Private functions
......@@ -122,7 +122,7 @@ static inline libvlc_event_manager_t * mlist_em(libvlc_media_list_player_t * p_m
static inline libvlc_event_manager_t * mplayer_em(libvlc_media_list_player_t * p_mlp)
{
assert_locked(p_mlp);
return libvlc_media_player_event_manager(p_mlp->p_mi, NULL);
return libvlc_media_player_event_manager(p_mlp->p_mi);
}
/**************************************************************************
......@@ -440,7 +440,7 @@ set_current_playing_item(libvlc_media_list_player_t * p_mlp, libvlc_media_list_p
if (!p_mlp->p_mi)
p_mlp->p_mi = libvlc_media_player_new_from_media(p_md, NULL);
libvlc_media_player_set_media(p_mlp->p_mi, p_md, NULL);
libvlc_media_player_set_media(p_mlp->p_mi, p_md);
install_media_player_observer(p_mlp);
libvlc_media_release(p_md); /* for libvlc_media_list_item_at_index */
......@@ -529,10 +529,8 @@ libvlc_media_list_player_event_manager(libvlc_media_list_player_t * p_mlp)
/**************************************************************************
* set_media_player (Public)
**************************************************************************/
void libvlc_media_list_player_set_media_player(libvlc_media_list_player_t * p_mlp, libvlc_media_player_t * p_mi, libvlc_exception_t * p_e)
void libvlc_media_list_player_set_media_player(libvlc_media_list_player_t * p_mlp, libvlc_media_player_t * p_mi)
{
VLC_UNUSED(p_e);
lock(p_mlp);
if (p_mlp->p_mi)
......@@ -551,9 +549,8 @@ void libvlc_media_list_player_set_media_player(libvlc_media_list_player_t * p_ml
/**************************************************************************
* set_media_list (Public)
**************************************************************************/
void libvlc_media_list_player_set_media_list(libvlc_media_list_player_t * p_mlp, libvlc_media_list_t * p_mlist, libvlc_exception_t * p_e)
void libvlc_media_list_player_set_media_list(libvlc_media_list_player_t * p_mlp, libvlc_media_list_t * p_mlist)
{
VLC_UNUSED( p_e );
assert (p_mlist);
lock(p_mlp);
......@@ -606,9 +603,9 @@ void libvlc_media_list_player_pause(libvlc_media_list_player_t * p_mlp, libvlc_e
* is_playing (Public)
**************************************************************************/
int
libvlc_media_list_player_is_playing(libvlc_media_list_player_t * p_mlp, libvlc_exception_t * p_e)
libvlc_media_list_player_is_playing(libvlc_media_list_player_t * p_mlp)
{
libvlc_state_t state = libvlc_media_player_get_state(p_mlp->p_mi, p_e);
libvlc_state_t state = libvlc_media_player_get_state(p_mlp->p_mi);
return (state == libvlc_Opening) || (state == libvlc_Buffering) ||
(state == libvlc_Playing);
}
......@@ -617,20 +614,18 @@ libvlc_media_list_player_is_playing(libvlc_media_list_player_t * p_mlp, libvlc_e
* State (Public)
**************************************************************************/
libvlc_state_t
libvlc_media_list_player_get_state(libvlc_media_list_player_t * p_mlp, libvlc_exception_t * p_e)
libvlc_media_list_player_get_state(libvlc_media_list_player_t * p_mlp)
{
if (!p_mlp->p_mi)
return libvlc_Ended;
return libvlc_media_player_get_state(p_mlp->p_mi, p_e);
return libvlc_media_player_get_state(p_mlp->p_mi);
}
/**************************************************************************
* Play item at index (Public)
**************************************************************************/
void libvlc_media_list_player_play_item_at_index(libvlc_media_list_player_t * p_mlp, int i_index, libvlc_exception_t * p_e)
void libvlc_media_list_player_play_item_at_index(libvlc_media_list_player_t * p_mlp, int i_index, libvlc_exception_t *p_e)
{
VLC_UNUSED(p_e);
lock(p_mlp);
set_current_playing_item(p_mlp, libvlc_media_list_path_with_root_index(i_index));
libvlc_media_player_play(p_mlp->p_mi, p_e);
......@@ -667,7 +662,7 @@ void libvlc_media_list_player_play_item(libvlc_media_list_player_t * p_mlp, libv
*
* Lock must be held.
**************************************************************************/
static void stop(libvlc_media_list_player_t * p_mlp, libvlc_exception_t * p_e)
static void stop(libvlc_media_list_player_t * p_mlp)
{
assert_locked(p_mlp);
......@@ -675,7 +670,7 @@ static void stop(libvlc_media_list_player_t * p_mlp, libvlc_exception_t * p_e)
{
/* We are not interested in getting media stop event now */
uninstall_media_player_observer(p_mlp);
libvlc_media_player_stop(p_mlp->p_mi, p_e);
libvlc_media_player_stop(p_mlp->p_mi);
install_media_player_observer(p_mlp);
}
......@@ -686,11 +681,10 @@ static void stop(libvlc_media_list_player_t * p_mlp, libvlc_exception_t * p_e)
/**************************************************************************
* Stop (Public)
**************************************************************************/
void libvlc_media_list_player_stop(libvlc_media_list_player_t * p_mlp,
libvlc_exception_t * p_e)
void libvlc_media_list_player_stop(libvlc_media_list_player_t * p_mlp)
{
lock(p_mlp);
stop(p_mlp, p_e);
stop(p_mlp);
unlock(p_mlp);
}
......@@ -800,11 +794,8 @@ void libvlc_media_list_player_previous(libvlc_media_list_player_t * p_mlp,
**************************************************************************/
void libvlc_media_list_player_set_playback_mode(
libvlc_media_list_player_t * p_mlp,
libvlc_playback_mode_t e_mode,
libvlc_exception_t * p_e )
libvlc_playback_mode_t e_mode )
{
VLC_UNUSED(p_e);
lock(p_mlp);
p_mlp->e_playback_mode = e_mode;
unlock(p_mlp);
......
......@@ -497,11 +497,8 @@ void libvlc_media_player_retain( libvlc_media_player_t *p_mi )
**************************************************************************/
void libvlc_media_player_set_media(
libvlc_media_player_t *p_mi,
libvlc_media_t *p_md,
libvlc_exception_t *p_e )
libvlc_media_t *p_md )
{
VLC_UNUSED(p_e);
lock(p_mi);
/* FIXME I am not sure if it is a user request or on die(eof/error)
......@@ -543,12 +540,9 @@ void libvlc_media_player_set_media(
* Get the Media descriptor associated with the instance.
**************************************************************************/
libvlc_media_t *
libvlc_media_player_get_media(
libvlc_media_player_t *p_mi,
libvlc_exception_t *p_e )
libvlc_media_player_get_media( libvlc_media_player_t *p_mi )
{
libvlc_media_t *p_m;
VLC_UNUSED(p_e);
lock(p_mi);
p_m = p_mi->p_md;
......@@ -562,12 +556,8 @@ libvlc_media_player_get_media(
* Get the event Manager.
**************************************************************************/
libvlc_event_manager_t *
libvlc_media_player_event_manager(
libvlc_media_player_t *p_mi,
libvlc_exception_t *p_e )
libvlc_media_player_event_manager( libvlc_media_player_t *p_mi )
{
VLC_UNUSED(p_e);
return p_mi->p_event_manager;
}
......@@ -656,13 +646,13 @@ void libvlc_media_player_pause( libvlc_media_player_t *p_mi,
if( !p_input_thread )
return;
libvlc_state_t state = libvlc_media_player_get_state( p_mi, p_e );
libvlc_state_t state = libvlc_media_player_get_state( p_mi );
if( state == libvlc_Playing || state == libvlc_Buffering )
{
if( libvlc_media_player_can_pause( p_mi, p_e ) )
input_Control( p_input_thread, INPUT_SET_STATE, PAUSE_S );
else
libvlc_media_player_stop( p_mi, p_e );
libvlc_media_player_stop( p_mi );
}
else
input_Control( p_input_thread, INPUT_SET_STATE, PLAYING_S );
......@@ -675,20 +665,18 @@ void libvlc_media_player_pause( libvlc_media_player_t *p_mi,
*
* Enter with lock held.
**************************************************************************/
int libvlc_media_player_is_playing( libvlc_media_player_t *p_mi,
libvlc_exception_t *p_e )
int libvlc_media_player_is_playing( libvlc_media_player_t *p_mi )
{
libvlc_state_t state = libvlc_media_player_get_state( p_mi, p_e );
libvlc_state_t state = libvlc_media_player_get_state( p_mi );
return (libvlc_Playing == state) || (libvlc_Buffering == state);
}
/**************************************************************************
* Stop playing.
**************************************************************************/
void libvlc_media_player_stop( libvlc_media_player_t *p_mi,
libvlc_exception_t *p_e )
void libvlc_media_player_stop( libvlc_media_player_t *p_mi )
{
libvlc_state_t state = libvlc_media_player_get_state( p_mi, p_e );
libvlc_state_t state = libvlc_media_player_get_state( p_mi );
lock(p_mi);
release_input_thread( p_mi, true ); /* This will stop the input thread */
......@@ -711,10 +699,8 @@ void libvlc_media_player_stop( libvlc_media_player_t *p_mi,
* set_nsobject
**************************************************************************/
void libvlc_media_player_set_nsobject( libvlc_media_player_t *p_mi,
void * drawable,
libvlc_exception_t *p_e )
void * drawable )
{
(void) p_e;
p_mi->drawable.nsobject = drawable;
}
......@@ -730,10 +716,8 @@ void * libvlc_media_player_get_nsobject( libvlc_media_player_t *p_mi )
* set_agl
**************************************************************************/
void libvlc_media_player_set_agl( libvlc_media_player_t *p_mi,
uint32_t drawable,
libvlc_exception_t *p_e )
uint32_t drawable )
{
(void) p_e;
p_mi->drawable.agl = drawable;
}
......@@ -749,10 +733,8 @@ uint32_t libvlc_media_player_get_agl( libvlc_media_player_t *p_mi )
* set_xwindow
**************************************************************************/
void libvlc_media_player_set_xwindow( libvlc_media_player_t *p_mi,
uint32_t drawable,
libvlc_exception_t *p_e )
uint32_t drawable )
{
(void) p_e;
p_mi->drawable.xid = drawable;
}
......@@ -768,10 +750,8 @@ uint32_t libvlc_media_player_get_xwindow( libvlc_media_player_t *p_mi )
* set_hwnd
**************************************************************************/
void libvlc_media_player_set_hwnd( libvlc_media_player_t *p_mi,
void *drawable,
libvlc_exception_t *p_e )
void *drawable )
{
(void) p_e;
p_mi->drawable.hwnd = drawable;
}
......@@ -1110,9 +1090,8 @@ float libvlc_media_player_get_rate(
return f_rate;
}
libvlc_state_t libvlc_media_player_get_state( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e )
libvlc_state_t libvlc_media_player_get_state( libvlc_media_player_t *p_mi )
{
VLC_UNUSED(p_e);
lock(p_mi);
libvlc_state_t state = p_mi->state;
unlock(p_mi);
......
......@@ -227,16 +227,12 @@ int mediacontrol_set_visual( mediacontrol_Instance *self,
WINDOWHANDLE visual_id,
mediacontrol_Exception *exception )
{
libvlc_exception_t ex;
mediacontrol_exception_init( exception );
libvlc_exception_init( &ex );
#ifdef WIN32
libvlc_media_player_set_hwnd( self->p_media_player, visual_id, &ex );
libvlc_media_player_set_hwnd( self->p_media_player, visual_id );
#else
libvlc_media_player_set_xwindow( self->p_media_player, visual_id, &ex );
libvlc_media_player_set_xwindow( self->p_media_player, visual_id );
#endif
HANDLE_LIBVLC_EXCEPTION_ZERO( &ex );
return true;
}
......
......@@ -189,8 +189,7 @@ mediacontrol_start( mediacontrol_Instance *self,
mediacontrol_exception_init( exception );
libvlc_exception_init( &ex );
p_media = libvlc_media_player_get_media( self->p_media_player, &ex );
HANDLE_LIBVLC_EXCEPTION_VOID( &ex );
p_media = libvlc_media_player_get_media( self->p_media_player );
if ( ! p_media )
{
......@@ -221,8 +220,7 @@ mediacontrol_start( mediacontrol_Instance *self,
HANDLE_LIBVLC_EXCEPTION_VOID( &ex );
}
libvlc_media_player_set_media( self->p_media_player, p_media, &ex );
HANDLE_LIBVLC_EXCEPTION_VOID( &ex );
libvlc_media_player_set_media( self->p_media_player, p_media );
libvlc_media_player_play( self->p_media_player, &ex );
HANDLE_LIBVLC_EXCEPTION_VOID( &ex );
......@@ -261,8 +259,7 @@ mediacontrol_stop( mediacontrol_Instance *self,
mediacontrol_exception_init( exception );
libvlc_exception_init( &ex );
libvlc_media_player_stop( self->p_media_player, &ex );
HANDLE_LIBVLC_EXCEPTION_VOID( &ex );
libvlc_media_player_stop( self->p_media_player );
}
/**************************************************************************
......@@ -283,8 +280,7 @@ mediacontrol_set_mrl( mediacontrol_Instance *self,
p_media = libvlc_media_new( self->p_instance, psz_file, &ex );
HANDLE_LIBVLC_EXCEPTION_VOID( &ex );
libvlc_media_player_set_media( self->p_media_player, p_media, &ex );
HANDLE_LIBVLC_EXCEPTION_VOID( &ex );
libvlc_media_player_set_media( self->p_media_player, p_media );
}
char *
......@@ -297,8 +293,7 @@ mediacontrol_get_mrl( mediacontrol_Instance *self,
mediacontrol_exception_init( exception );
libvlc_exception_init( &ex );
p_media = libvlc_media_player_get_media( self->p_media_player, &ex );
HANDLE_LIBVLC_EXCEPTION_NULL( &ex );
p_media = libvlc_media_player_get_media( self->p_media_player );
if ( ! p_media )
{
......@@ -338,15 +333,7 @@ mediacontrol_get_stream_information( mediacontrol_Instance *self,
return NULL;
}
p_media = libvlc_media_player_get_media( self->p_media_player, &ex );
if( libvlc_exception_raised( &ex ) )
{
free( retval );
RAISE( mediacontrol_InternalException, libvlc_errmsg( ) );
libvlc_exception_clear( &ex );
return NULL;
}
p_media = libvlc_media_player_get_media( self->p_media_player );
if( ! p_media )
{
/* No p_media defined */
......@@ -359,15 +346,7 @@ mediacontrol_get_stream_information( mediacontrol_Instance *self,
{
libvlc_state_t state;
state = libvlc_media_player_get_state( self->p_media_player, &ex );
if( libvlc_exception_raised( &ex ) )
{
free( retval );
RAISE( mediacontrol_InternalException, libvlc_errmsg() );
libvlc_exception_clear( &ex );
return NULL;
}
state = libvlc_media_player_get_state( self->p_media_player );
switch( state )
{
case libvlc_NothingSpecial:
......
......@@ -40,8 +40,7 @@ static void test_events_callback_and_detach( const libvlc_event_t * event, void
bool * callback_was_called = user_data;
libvlc_event_manager_t *em;
em = libvlc_media_player_event_manager (event->p_obj, &ex);
catch();
em = libvlc_media_player_event_manager (event->p_obj);
libvlc_event_detach (em, event->type, test_events_callback_and_detach, user_data, &ex);
*callback_was_called = true;
......@@ -82,7 +81,7 @@ static void test_events (const char ** argv, int argc)
mi = libvlc_media_player_new (vlc, &ex);
catch ();
em = libvlc_media_player_event_manager (mi, &ex);
em = libvlc_media_player_event_manager (mi);
log ("+ Testing attaching to Media Instance\n");
......
......@@ -139,7 +139,7 @@ static void test_media_list_player_items_queue(const char** argv, int argc)
queue_expected_item(&check, media_list_add_file_path(vlc, subitems, file));
libvlc_media_list_release(subitems);
libvlc_media_list_player_set_media_list (mlp, ml, &ex);
libvlc_media_list_player_set_media_list (mlp, ml);
libvlc_event_manager_t * em = libvlc_media_list_player_event_manager(mlp);
libvlc_event_attach(em, libvlc_MediaListPlayerNextItemSet, check_items_order_callback, &check, &ex);
......@@ -151,17 +151,12 @@ static void test_media_list_player_items_queue(const char** argv, int argc)
// Wait until all item are read
wait_queued_items(&check);
libvlc_media_list_player_stop (mlp, &ex);
catch ();
while (libvlc_media_list_player_is_playing (mlp, &ex))
catch() ;
libvlc_media_list_player_stop (mlp);
while (libvlc_media_list_player_is_playing (mlp))
sched_yield();
libvlc_media_list_player_release (mlp);
catch ();
libvlc_release (vlc);
catch ();
}
static void test_media_list_player_previous(const char** argv, int argc)
......@@ -196,21 +191,21 @@ static void test_media_list_player_previous(const char** argv, int argc)
media_list_add_file_path (vlc, ml, file);
media_list_add_file_path (vlc, ml, file);
libvlc_media_list_player_set_media_list (mlp, ml, &ex);
libvlc_media_list_player_set_media_list (mlp, ml);
libvlc_media_list_player_play_item (mlp, md, &ex);
catch ();
while (!libvlc_media_list_player_is_playing (mlp, &ex))
catch() ;
while (!libvlc_media_list_player_is_playing (mlp))
sched_yield();
libvlc_media_release (md);
libvlc_media_list_player_previous (mlp, &ex);
catch ();
while (!libvlc_media_list_player_is_playing (mlp, &ex))
catch() ;
while (!libvlc_media_list_player_is_playing (mlp))
sched_yield();
libvlc_media_list_player_pause (mlp, &ex);
catch();
......@@ -218,32 +213,27 @@ static void test_media_list_player_previous(const char** argv, int argc)
libvlc_media_list_player_previous (mlp, &ex);
catch ();
while (!libvlc_media_list_player_is_playing (mlp, &ex))
catch() ;
while (!libvlc_media_list_player_is_playing (mlp))
sched_yield();
libvlc_media_list_player_stop (mlp, &ex);
catch ();
libvlc_media_list_player_stop (mlp);
while (libvlc_media_list_player_is_playing (mlp, &ex))
catch() ;
while (libvlc_media_list_player_is_playing (mlp))
sched_yield();
libvlc_media_list_player_previous (mlp, &ex);
catch ();
while (!libvlc_media_list_player_is_playing (mlp, &ex))
catch() ;
while (!libvlc_media_list_player_is_playing (mlp))
sched_yield();
libvlc_media_list_player_stop (mlp, &ex);
catch ();
libvlc_media_list_player_stop (mlp);
while (libvlc_media_list_player_is_playing (mlp, &ex))
catch() ;
while (libvlc_media_list_player_is_playing (mlp))
sched_yield();
libvlc_media_list_player_release (mlp);
catch ();
libvlc_release (vlc);
catch ();
}
static void test_media_list_player_next(const char** argv, int argc)
......@@ -278,21 +268,21 @@ static void test_media_list_player_next(const char** argv, int argc)
media_list_add_file_path (vlc, ml, file);
media_list_add_file_path (vlc, ml, file);
libvlc_media_list_player_set_media_list (mlp, ml, &ex);
libvlc_media_list_player_set_media_list (mlp, ml);
libvlc_media_list_player_play_item (mlp, md, &ex);
catch ();
libvlc_media_release (md);
while (!libvlc_media_list_player_is_playing (mlp, &ex))
catch() ;
while (!libvlc_media_list_player_is_playing (mlp))
sched_yield();
libvlc_media_list_player_next (mlp, &ex);
catch ();
while (!libvlc_media_list_player_is_playing (mlp, &ex))
catch() ;
while (!libvlc_media_list_player_is_playing (mlp))
sched_yield();
libvlc_media_list_player_pause (mlp, &ex);
catch();
......@@ -300,32 +290,26 @@ static void test_media_list_player_next(const char** argv, int argc)
libvlc_media_list_player_next (mlp, &ex);
catch ();
while (!libvlc_media_list_player_is_playing (mlp, &ex))
catch() ;
while (!libvlc_media_list_player_is_playing (mlp))
sched_yield();
libvlc_media_list_player_stop (mlp, &ex);
catch ();
libvlc_media_list_player_stop (mlp);
while (libvlc_media_list_player_is_playing (mlp, &ex))
catch() ;
while (libvlc_media_list_player_is_playing (mlp))
sched_yield();
libvlc_media_list_player_next (mlp, &ex);
catch ();
while (!libvlc_media_list_player_is_playing (mlp, &ex))
catch() ;
while (!libvlc_media_list_player_is_playing (mlp))
sched_yield();
libvlc_media_list_player_stop (mlp, &ex);
catch ();
while (libvlc_media_list_player_is_playing (mlp, &ex))
catch() ;
libvlc_media_list_player_stop (mlp);
while (libvlc_media_list_player_is_playing (mlp))
sched_yield();
libvlc_media_list_player_release (mlp);
catch ();
libvlc_release (vlc);
catch ();
}
static void test_media_list_player_pause_stop(const char** argv, int argc)
......@@ -354,30 +338,25 @@ static void test_media_list_player_pause_stop(const char** argv, int argc)
libvlc_media_list_add_media( ml, md, &ex );
catch ();
libvlc_media_list_player_set_media_list( mlp, ml, &ex );
libvlc_media_list_player_set_media_list( mlp, ml );
libvlc_media_list_player_play_item( mlp, md, &ex );
catch ();
while (!libvlc_media_list_player_is_playing (mlp, &ex))
catch() ;
while (!libvlc_media_list_player_is_playing (mlp))
sched_yield();
libvlc_media_list_player_pause (mlp, &ex);
catch();
libvlc_media_list_player_stop (mlp, &ex);
catch ();
libvlc_media_list_player_stop (mlp);
while (libvlc_media_list_player_is_playing (mlp, &ex))
catch() ;
while (libvlc_media_list_player_is_playing (mlp))
sched_yield();
libvlc_media_release (md);
libvlc_media_list_player_release (mlp);
catch ();
libvlc_release (vlc);
catch ();
}
static void test_media_list_player_play_item_at_index(const char** argv, int argc)
......@@ -409,28 +388,22 @@ static void test_media_list_player_play_item_at_index(const char** argv, int arg
catch ();
}
libvlc_media_list_player_set_media_list( mlp, ml, &ex );
libvlc_media_list_player_set_media_list( mlp, ml );
libvlc_media_list_player_play_item_at_index( mlp, 0, &ex );
catch ();
while (!libvlc_media_list_player_is_playing (mlp, &ex))
catch() ;
while (!libvlc_media_list_player_is_playing (mlp))
sched_yield();
libvlc_media_list_player_stop (mlp, &ex);
catch ();
libvlc_media_list_player_stop (mlp);
while (libvlc_media_list_player_is_playing (mlp, &ex))
catch() ;
while (libvlc_media_list_player_is_playing (mlp))
sched_yield();
libvlc_media_release (md);
catch ();
libvlc_media_list_player_release (mlp);
catch ();
libvlc_release (vlc);
catch ();
}
static void test_media_list_player_playback_options (const char** argv, int argc)
......@@ -542,75 +515,60 @@ static void test_media_list_player_playback_options (const char** argv, int argc
mlp = libvlc_media_list_player_new (vlc, &ex);
catch ();
libvlc_media_list_player_set_media_list (mlp, ml, &ex);
catch ();
libvlc_media_list_player_set_media_list (mlp, ml);
// Test default playback mode
libvlc_media_list_player_set_playback_mode(mlp, libvlc_playback_mode_default, &ex);
catch ();
libvlc_media_list_player_set_playback_mode(mlp, libvlc_playback_mode_default);
libvlc_media_list_player_play_item (mlp, md, &ex);
catch ();
while (!libvlc_media_list_player_is_playing (mlp, &ex))
catch() ;
while (!libvlc_media_list_player_is_playing (mlp))
sched_yield();
libvlc_media_release (md);
catch ();
libvlc_media_release (md2);
catch ();
libvlc_media_release (md3);
catch ();
libvlc_media_release (md4);
catch ();
libvlc_media_release (md5);
catch ();
libvlc_media_list_player_stop (mlp, &ex);
catch ();
libvlc_media_list_player_stop (mlp);
while (libvlc_media_list_player_is_playing (mlp, &ex))
catch() ;
while (libvlc_media_list_player_is_playing (mlp))
sched_yield();
// Test looping playback mode
log ("Testing media player playback option - Loop\n");
libvlc_media_list_player_set_playback_mode(mlp, libvlc_playback_mode_loop, &ex);
catch ();
libvlc_media_list_player_set_playback_mode(mlp, libvlc_playback_mode_loop);
libvlc_media_list_player_play_item (mlp, md, &ex);
catch ();
while (!libvlc_media_list_player_is_playing (mlp, &ex))
catch() ;
while (!libvlc_media_list_player_is_playing (mlp))
sched_yield();
libvlc_media_list_player_stop (mlp, &ex);
catch ();
libvlc_media_list_player_stop (mlp);
while (libvlc_media_list_player_is_playing (mlp, &ex))
catch() ;
while (libvlc_media_list_player_is_playing (mlp))
sched_yield();
// Test repeat playback mode
log ("Testing media player playback option - Repeat\n");
libvlc_media_list_player_set_playback_mode(mlp, libvlc_playback_mode_repeat, &ex);
catch ();
libvlc_media_list_player_set_playback_mode(mlp, libvlc_playback_mode_repeat);
libvlc_media_list_player_play_item (mlp, md, &ex);
catch ();
while (!libvlc_media_list_player_is_playing (mlp, &ex))
catch() ;
while (!libvlc_media_list_player_is_playing (mlp))
sched_yield();
libvlc_media_list_player_stop (mlp, &ex);
catch ();
libvlc_media_list_player_stop (mlp);
while (libvlc_media_list_player_is_playing (mlp, &ex))
catch() ;
while (libvlc_media_list_player_is_playing (mlp))
sched_yield();
libvlc_media_list_player_release (mlp);
catch ();
libvlc_release (vlc);
catch ();
}
......
......@@ -50,22 +50,16 @@ static void test_media_player_play_stop(const char** argv, int argc)
/* Wait a correct state */
libvlc_state_t state;
do {
state = libvlc_media_player_get_state (mi, &ex);
catch ();
state = libvlc_media_player_get_state (mi);
} while( state != libvlc_Playing &&
state != libvlc_Error &&
state != libvlc_Ended );
assert( state == libvlc_Playing || state == libvlc_Ended );
libvlc_media_player_stop (mi, &ex);
catch ();
libvlc_media_player_stop (mi);
libvlc_media_player_release (mi);
catch ();
libvlc_release (vlc);
catch ();
}
static void test_media_player_pause_stop(const char** argv, int argc)
......@@ -97,7 +91,7 @@ static void test_media_player_pause_stop(const char** argv, int argc)
/* Wait a correct state */
libvlc_state_t state;
do {
state = libvlc_media_player_get_state (mi, &ex);
state = libvlc_media_player_get_state (mi);
catch ();
} while( state != libvlc_Playing &&
state != libvlc_Error &&
......@@ -115,24 +109,17 @@ static void test_media_player_pause_stop(const char** argv, int argc)
/* Wait a correct state */
do {
state = libvlc_media_player_get_state (mi, &ex);
catch ();
state = libvlc_media_player_get_state (mi);
} while( state != libvlc_Paused &&
state != libvlc_Error &&
state != libvlc_Ended );
assert( state == libvlc_Paused || state == libvlc_Ended );
catch();
#endif
libvlc_media_player_stop (mi, &ex);
catch ();
libvlc_media_player_stop (mi);
libvlc_media_player_release (mi);
catch ();
libvlc_release (vlc);
catch ();
}
......
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