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 * ...@@ -92,14 +92,12 @@ VLC_PUBLIC_API libvlc_event_manager_t *
VLC_PUBLIC_API void VLC_PUBLIC_API void
libvlc_media_list_player_set_media_player( libvlc_media_list_player_set_media_player(
libvlc_media_list_player_t * p_mlp, libvlc_media_list_player_t * p_mlp,
libvlc_media_player_t * p_mi, libvlc_media_player_t * p_mi );
libvlc_exception_t * p_e );
VLC_PUBLIC_API void VLC_PUBLIC_API void
libvlc_media_list_player_set_media_list( libvlc_media_list_player_set_media_list(
libvlc_media_list_player_t * p_mlp, libvlc_media_list_player_t * p_mlp,
libvlc_media_list_t * p_mlist, libvlc_media_list_t * p_mlist );
libvlc_exception_t * p_e );
/** /**
* Play media list * Play media list
...@@ -129,19 +127,16 @@ VLC_PUBLIC_API void ...@@ -129,19 +127,16 @@ VLC_PUBLIC_API void
* \return true for playing and false for not playing * \return true for playing and false for not playing
*/ */
VLC_PUBLIC_API int VLC_PUBLIC_API int
libvlc_media_list_player_is_playing( libvlc_media_list_player_t * p_mlp, libvlc_media_list_player_is_playing( libvlc_media_list_player_t * p_mlp );
libvlc_exception_t * p_e );
/** /**
* Get current libvlc_state of media list player * Get current libvlc_state of media list player
* *
* \param p_mlp media list player instance * \param p_mlp media list player instance
* \param p_e initialized exception instance
* \return libvlc_state_t for media list player * \return libvlc_state_t for media list player
*/ */
VLC_PUBLIC_API libvlc_state_t VLC_PUBLIC_API libvlc_state_t
libvlc_media_list_player_get_state( libvlc_media_list_player_t * p_mlp, libvlc_media_list_player_get_state( libvlc_media_list_player_t * p_mlp );
libvlc_exception_t * p_e );
/** /**
* Play media list item at position index * Play media list item at position index
...@@ -166,11 +161,9 @@ VLC_PUBLIC_API void ...@@ -166,11 +161,9 @@ VLC_PUBLIC_API void
* Stop playing media list * Stop playing media list
* *
* \param p_mlp media list player instance * \param p_mlp media list player instance
* \param p_e initialized exception instance
*/ */
VLC_PUBLIC_API void VLC_PUBLIC_API void
libvlc_media_list_player_stop( libvlc_media_list_player_t * p_mlp, libvlc_media_list_player_stop( libvlc_media_list_player_t * p_mlp );
libvlc_exception_t * p_e );
/** /**
* Play next item from media list * Play next item from media list
...@@ -199,13 +192,11 @@ VLC_PUBLIC_API void ...@@ -199,13 +192,11 @@ VLC_PUBLIC_API void
* *
* \param p_mlp media list player instance * \param p_mlp media list player instance
* \param e_mode playback mode specification * \param e_mode playback mode specification
* \param p_e initialized exception instance
*/ */
VLC_PUBLIC_API void VLC_PUBLIC_API void
libvlc_media_list_player_set_playback_mode( libvlc_media_list_player_set_playback_mode(
libvlc_media_list_player_t * p_mlp, libvlc_media_list_player_t * p_mlp,
libvlc_playback_mode_t e_mode, libvlc_playback_mode_t e_mode );
libvlc_exception_t * p_e );
/** @} media_list_player */ /** @} media_list_player */
......
...@@ -147,37 +147,33 @@ VLC_PUBLIC_API void libvlc_media_player_retain( libvlc_media_player_t * ); ...@@ -147,37 +147,33 @@ VLC_PUBLIC_API void libvlc_media_player_retain( libvlc_media_player_t * );
* \param p_mi the Media Player * \param p_mi the Media Player
* \param p_md the Media. Afterwards the p_md can be safely * \param p_md the Media. Afterwards the p_md can be safely
* destroyed. * 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. * Get the media used by the media_player.
* *
* \param p_mi 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 * \return the media associated with p_mi, or NULL if no
* media is associated * 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. * Get the Event Manager from which the media player send event.
* *
* \param p_mi the Media Player * \param p_mi the Media Player
* \param p_e an initialized exception pointer
* \return the event manager associated with p_mi * \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 * is_playing
* *
* \param p_mi the Media Player * \param p_mi the Media Player
* \param p_e an initialized exception pointer
* \return 1 if the media player is playing, 0 otherwise * \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 * Play
...@@ -201,7 +197,7 @@ VLC_PUBLIC_API void libvlc_media_player_pause ( libvlc_media_player_t *, libvlc_ ...@@ -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_mi the Media Player
* \param p_e an initialized exception pointer * \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. * 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 ...@@ -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 p_mi the Media Player
* \param drawable the NSView handler * \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(). * 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 * ...@@ -237,7 +232,7 @@ VLC_PUBLIC_API void * libvlc_media_player_get_nsobject ( libvlc_media_player_t *
* \param drawable the agl handler * \param drawable the agl handler
* \param p_e an initialized exception pointer * \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(). * 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 ...@@ -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 p_mi the Media Player
* \param drawable the ID of the X window * \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 * 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 ...@@ -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 p_mi the Media Player
* \param drawable windows handle of the drawable * \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 * 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 ...@@ -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_mi the Media Player
* \param p_e an initialized exception pointer * \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 * Get movie fps rate
......
...@@ -84,7 +84,7 @@ static void set_relative_playlist_position_and_play( ...@@ -84,7 +84,7 @@ static void set_relative_playlist_position_and_play(
libvlc_media_list_player_t * p_mlp, libvlc_media_list_player_t * p_mlp,
int i_relative_position, int i_relative_position,
libvlc_exception_t * p_e); 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 * Private functions
...@@ -122,7 +122,7 @@ static inline libvlc_event_manager_t * mlist_em(libvlc_media_list_player_t * p_m ...@@ -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) static inline libvlc_event_manager_t * mplayer_em(libvlc_media_list_player_t * p_mlp)
{ {
assert_locked(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 ...@@ -440,7 +440,7 @@ set_current_playing_item(libvlc_media_list_player_t * p_mlp, libvlc_media_list_p
if (!p_mlp->p_mi) if (!p_mlp->p_mi)
p_mlp->p_mi = libvlc_media_player_new_from_media(p_md, NULL); 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); install_media_player_observer(p_mlp);
libvlc_media_release(p_md); /* for libvlc_media_list_item_at_index */ 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) ...@@ -529,10 +529,8 @@ libvlc_media_list_player_event_manager(libvlc_media_list_player_t * p_mlp)
/************************************************************************** /**************************************************************************
* set_media_player (Public) * 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); lock(p_mlp);
if (p_mlp->p_mi) if (p_mlp->p_mi)
...@@ -551,9 +549,8 @@ void libvlc_media_list_player_set_media_player(libvlc_media_list_player_t * p_ml ...@@ -551,9 +549,8 @@ void libvlc_media_list_player_set_media_player(libvlc_media_list_player_t * p_ml
/************************************************************************** /**************************************************************************
* set_media_list (Public) * 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); assert (p_mlist);
lock(p_mlp); lock(p_mlp);
...@@ -606,9 +603,9 @@ void libvlc_media_list_player_pause(libvlc_media_list_player_t * p_mlp, libvlc_e ...@@ -606,9 +603,9 @@ void libvlc_media_list_player_pause(libvlc_media_list_player_t * p_mlp, libvlc_e
* is_playing (Public) * is_playing (Public)
**************************************************************************/ **************************************************************************/
int 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) || return (state == libvlc_Opening) || (state == libvlc_Buffering) ||
(state == libvlc_Playing); (state == libvlc_Playing);
} }
...@@ -617,20 +614,18 @@ libvlc_media_list_player_is_playing(libvlc_media_list_player_t * p_mlp, libvlc_e ...@@ -617,20 +614,18 @@ libvlc_media_list_player_is_playing(libvlc_media_list_player_t * p_mlp, libvlc_e
* State (Public) * State (Public)
**************************************************************************/ **************************************************************************/
libvlc_state_t 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) if (!p_mlp->p_mi)
return libvlc_Ended; 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) * 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); lock(p_mlp);
set_current_playing_item(p_mlp, libvlc_media_list_path_with_root_index(i_index)); 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); 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 ...@@ -667,7 +662,7 @@ void libvlc_media_list_player_play_item(libvlc_media_list_player_t * p_mlp, libv
* *
* Lock must be held. * 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); assert_locked(p_mlp);
...@@ -675,7 +670,7 @@ static void stop(libvlc_media_list_player_t * p_mlp, libvlc_exception_t * p_e) ...@@ -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 */ /* We are not interested in getting media stop event now */
uninstall_media_player_observer(p_mlp); 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); 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) ...@@ -686,11 +681,10 @@ static void stop(libvlc_media_list_player_t * p_mlp, libvlc_exception_t * p_e)
/************************************************************************** /**************************************************************************
* Stop (Public) * Stop (Public)
**************************************************************************/ **************************************************************************/
void libvlc_media_list_player_stop(libvlc_media_list_player_t * p_mlp, void libvlc_media_list_player_stop(libvlc_media_list_player_t * p_mlp)
libvlc_exception_t * p_e)
{ {
lock(p_mlp); lock(p_mlp);
stop(p_mlp, p_e); stop(p_mlp);
unlock(p_mlp); unlock(p_mlp);
} }
...@@ -800,11 +794,8 @@ void libvlc_media_list_player_previous(libvlc_media_list_player_t * 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( void libvlc_media_list_player_set_playback_mode(
libvlc_media_list_player_t * p_mlp, libvlc_media_list_player_t * p_mlp,
libvlc_playback_mode_t e_mode, libvlc_playback_mode_t e_mode )
libvlc_exception_t * p_e )
{ {
VLC_UNUSED(p_e);
lock(p_mlp); lock(p_mlp);
p_mlp->e_playback_mode = e_mode; p_mlp->e_playback_mode = e_mode;
unlock(p_mlp); unlock(p_mlp);
......
...@@ -497,11 +497,8 @@ void libvlc_media_player_retain( libvlc_media_player_t *p_mi ) ...@@ -497,11 +497,8 @@ void libvlc_media_player_retain( libvlc_media_player_t *p_mi )
**************************************************************************/ **************************************************************************/
void libvlc_media_player_set_media( void libvlc_media_player_set_media(
libvlc_media_player_t *p_mi, libvlc_media_player_t *p_mi,
libvlc_media_t *p_md, libvlc_media_t *p_md )
libvlc_exception_t *p_e )
{ {
VLC_UNUSED(p_e);
lock(p_mi); lock(p_mi);
/* FIXME I am not sure if it is a user request or on die(eof/error) /* 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( ...@@ -543,12 +540,9 @@ void libvlc_media_player_set_media(
* Get the Media descriptor associated with the instance. * Get the Media descriptor associated with the instance.
**************************************************************************/ **************************************************************************/
libvlc_media_t * libvlc_media_t *
libvlc_media_player_get_media( libvlc_media_player_get_media( libvlc_media_player_t *p_mi )
libvlc_media_player_t *p_mi,
libvlc_exception_t *p_e )
{ {
libvlc_media_t *p_m; libvlc_media_t *p_m;
VLC_UNUSED(p_e);
lock(p_mi); lock(p_mi);
p_m = p_mi->p_md; p_m = p_mi->p_md;
...@@ -562,12 +556,8 @@ libvlc_media_player_get_media( ...@@ -562,12 +556,8 @@ libvlc_media_player_get_media(
* Get the event Manager. * Get the event Manager.
**************************************************************************/ **************************************************************************/
libvlc_event_manager_t * libvlc_event_manager_t *
libvlc_media_player_event_manager( libvlc_media_player_event_manager( libvlc_media_player_t *p_mi )
libvlc_media_player_t *p_mi,
libvlc_exception_t *p_e )
{ {
VLC_UNUSED(p_e);
return p_mi->p_event_manager; return p_mi->p_event_manager;
} }
...@@ -656,13 +646,13 @@ void libvlc_media_player_pause( libvlc_media_player_t *p_mi, ...@@ -656,13 +646,13 @@ void libvlc_media_player_pause( libvlc_media_player_t *p_mi,
if( !p_input_thread ) if( !p_input_thread )
return; 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( state == libvlc_Playing || state == libvlc_Buffering )
{ {
if( libvlc_media_player_can_pause( p_mi, p_e ) ) if( libvlc_media_player_can_pause( p_mi, p_e ) )
input_Control( p_input_thread, INPUT_SET_STATE, PAUSE_S ); input_Control( p_input_thread, INPUT_SET_STATE, PAUSE_S );
else else
libvlc_media_player_stop( p_mi, p_e ); libvlc_media_player_stop( p_mi );
} }
else else
input_Control( p_input_thread, INPUT_SET_STATE, PLAYING_S ); 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, ...@@ -675,20 +665,18 @@ void libvlc_media_player_pause( libvlc_media_player_t *p_mi,
* *
* Enter with lock held. * Enter with lock held.
**************************************************************************/ **************************************************************************/
int libvlc_media_player_is_playing( libvlc_media_player_t *p_mi, int libvlc_media_player_is_playing( libvlc_media_player_t *p_mi )
libvlc_exception_t *p_e )
{ {
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); return (libvlc_Playing == state) || (libvlc_Buffering == state);
} }
/************************************************************************** /**************************************************************************
* Stop playing. * Stop playing.
**************************************************************************/ **************************************************************************/
void libvlc_media_player_stop( libvlc_media_player_t *p_mi, void libvlc_media_player_stop( libvlc_media_player_t *p_mi )
libvlc_exception_t *p_e )
{ {
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); lock(p_mi);
release_input_thread( p_mi, true ); /* This will stop the input thread */ 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, ...@@ -711,10 +699,8 @@ void libvlc_media_player_stop( libvlc_media_player_t *p_mi,
* set_nsobject * set_nsobject
**************************************************************************/ **************************************************************************/
void libvlc_media_player_set_nsobject( libvlc_media_player_t *p_mi, void libvlc_media_player_set_nsobject( libvlc_media_player_t *p_mi,
void * drawable, void * drawable )
libvlc_exception_t *p_e )
{ {
(void) p_e;
p_mi->drawable.nsobject = drawable; p_mi->drawable.nsobject = drawable;
} }
...@@ -730,10 +716,8 @@ void * libvlc_media_player_get_nsobject( libvlc_media_player_t *p_mi ) ...@@ -730,10 +716,8 @@ void * libvlc_media_player_get_nsobject( libvlc_media_player_t *p_mi )
* set_agl * set_agl
**************************************************************************/ **************************************************************************/
void libvlc_media_player_set_agl( libvlc_media_player_t *p_mi, void libvlc_media_player_set_agl( libvlc_media_player_t *p_mi,
uint32_t drawable, uint32_t drawable )
libvlc_exception_t *p_e )
{ {
(void) p_e;
p_mi->drawable.agl = drawable; p_mi->drawable.agl = drawable;
} }
...@@ -749,10 +733,8 @@ uint32_t libvlc_media_player_get_agl( libvlc_media_player_t *p_mi ) ...@@ -749,10 +733,8 @@ uint32_t libvlc_media_player_get_agl( libvlc_media_player_t *p_mi )
* set_xwindow * set_xwindow
**************************************************************************/ **************************************************************************/
void libvlc_media_player_set_xwindow( libvlc_media_player_t *p_mi, void libvlc_media_player_set_xwindow( libvlc_media_player_t *p_mi,
uint32_t drawable, uint32_t drawable )
libvlc_exception_t *p_e )
{ {
(void) p_e;
p_mi->drawable.xid = drawable; p_mi->drawable.xid = drawable;
} }
...@@ -768,10 +750,8 @@ uint32_t libvlc_media_player_get_xwindow( libvlc_media_player_t *p_mi ) ...@@ -768,10 +750,8 @@ uint32_t libvlc_media_player_get_xwindow( libvlc_media_player_t *p_mi )
* set_hwnd * set_hwnd
**************************************************************************/ **************************************************************************/
void libvlc_media_player_set_hwnd( libvlc_media_player_t *p_mi, void libvlc_media_player_set_hwnd( libvlc_media_player_t *p_mi,
void *drawable, void *drawable )
libvlc_exception_t *p_e )
{ {
(void) p_e;
p_mi->drawable.hwnd = drawable; p_mi->drawable.hwnd = drawable;
} }
...@@ -1110,9 +1090,8 @@ float libvlc_media_player_get_rate( ...@@ -1110,9 +1090,8 @@ float libvlc_media_player_get_rate(
return f_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); lock(p_mi);
libvlc_state_t state = p_mi->state; libvlc_state_t state = p_mi->state;
unlock(p_mi); unlock(p_mi);
......
...@@ -227,16 +227,12 @@ int mediacontrol_set_visual( mediacontrol_Instance *self, ...@@ -227,16 +227,12 @@ int mediacontrol_set_visual( mediacontrol_Instance *self,
WINDOWHANDLE visual_id, WINDOWHANDLE visual_id,
mediacontrol_Exception *exception ) mediacontrol_Exception *exception )
{ {
libvlc_exception_t ex;
mediacontrol_exception_init( exception ); mediacontrol_exception_init( exception );
libvlc_exception_init( &ex );
#ifdef WIN32 #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 #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 #endif
HANDLE_LIBVLC_EXCEPTION_ZERO( &ex );
return true; return true;
} }
......
...@@ -189,8 +189,7 @@ mediacontrol_start( mediacontrol_Instance *self, ...@@ -189,8 +189,7 @@ mediacontrol_start( mediacontrol_Instance *self,
mediacontrol_exception_init( exception ); mediacontrol_exception_init( exception );
libvlc_exception_init( &ex ); libvlc_exception_init( &ex );
p_media = libvlc_media_player_get_media( self->p_media_player, &ex ); p_media = libvlc_media_player_get_media( self->p_media_player );
HANDLE_LIBVLC_EXCEPTION_VOID( &ex );
if ( ! p_media ) if ( ! p_media )
{ {
...@@ -221,8 +220,7 @@ mediacontrol_start( mediacontrol_Instance *self, ...@@ -221,8 +220,7 @@ mediacontrol_start( mediacontrol_Instance *self,
HANDLE_LIBVLC_EXCEPTION_VOID( &ex ); HANDLE_LIBVLC_EXCEPTION_VOID( &ex );
} }
libvlc_media_player_set_media( self->p_media_player, p_media, &ex ); libvlc_media_player_set_media( self->p_media_player, p_media );
HANDLE_LIBVLC_EXCEPTION_VOID( &ex );
libvlc_media_player_play( self->p_media_player, &ex ); libvlc_media_player_play( self->p_media_player, &ex );
HANDLE_LIBVLC_EXCEPTION_VOID( &ex ); HANDLE_LIBVLC_EXCEPTION_VOID( &ex );
...@@ -261,8 +259,7 @@ mediacontrol_stop( mediacontrol_Instance *self, ...@@ -261,8 +259,7 @@ mediacontrol_stop( mediacontrol_Instance *self,
mediacontrol_exception_init( exception ); mediacontrol_exception_init( exception );
libvlc_exception_init( &ex ); libvlc_exception_init( &ex );
libvlc_media_player_stop( self->p_media_player, &ex ); libvlc_media_player_stop( self->p_media_player );
HANDLE_LIBVLC_EXCEPTION_VOID( &ex );
} }
/************************************************************************** /**************************************************************************
...@@ -283,8 +280,7 @@ mediacontrol_set_mrl( mediacontrol_Instance *self, ...@@ -283,8 +280,7 @@ mediacontrol_set_mrl( mediacontrol_Instance *self,
p_media = libvlc_media_new( self->p_instance, psz_file, &ex ); p_media = libvlc_media_new( self->p_instance, psz_file, &ex );
HANDLE_LIBVLC_EXCEPTION_VOID( &ex ); HANDLE_LIBVLC_EXCEPTION_VOID( &ex );
libvlc_media_player_set_media( self->p_media_player, p_media, &ex ); libvlc_media_player_set_media( self->p_media_player, p_media );
HANDLE_LIBVLC_EXCEPTION_VOID( &ex );
} }
char * char *
...@@ -297,8 +293,7 @@ mediacontrol_get_mrl( mediacontrol_Instance *self, ...@@ -297,8 +293,7 @@ mediacontrol_get_mrl( mediacontrol_Instance *self,
mediacontrol_exception_init( exception ); mediacontrol_exception_init( exception );
libvlc_exception_init( &ex ); libvlc_exception_init( &ex );
p_media = libvlc_media_player_get_media( self->p_media_player, &ex ); p_media = libvlc_media_player_get_media( self->p_media_player );
HANDLE_LIBVLC_EXCEPTION_NULL( &ex );
if ( ! p_media ) if ( ! p_media )
{ {
...@@ -338,15 +333,7 @@ mediacontrol_get_stream_information( mediacontrol_Instance *self, ...@@ -338,15 +333,7 @@ mediacontrol_get_stream_information( mediacontrol_Instance *self,
return NULL; return NULL;
} }
p_media = libvlc_media_player_get_media( self->p_media_player, &ex ); p_media = libvlc_media_player_get_media( self->p_media_player );
if( libvlc_exception_raised( &ex ) )
{
free( retval );
RAISE( mediacontrol_InternalException, libvlc_errmsg( ) );
libvlc_exception_clear( &ex );
return NULL;
}
if( ! p_media ) if( ! p_media )
{ {
/* No p_media defined */ /* No p_media defined */
...@@ -359,15 +346,7 @@ mediacontrol_get_stream_information( mediacontrol_Instance *self, ...@@ -359,15 +346,7 @@ mediacontrol_get_stream_information( mediacontrol_Instance *self,
{ {
libvlc_state_t state; libvlc_state_t state;
state = libvlc_media_player_get_state( self->p_media_player, &ex ); state = libvlc_media_player_get_state( self->p_media_player );
if( libvlc_exception_raised( &ex ) )
{
free( retval );
RAISE( mediacontrol_InternalException, libvlc_errmsg() );
libvlc_exception_clear( &ex );
return NULL;
}
switch( state ) switch( state )
{ {
case libvlc_NothingSpecial: case libvlc_NothingSpecial:
......
...@@ -40,8 +40,7 @@ static void test_events_callback_and_detach( const libvlc_event_t * event, void ...@@ -40,8 +40,7 @@ static void test_events_callback_and_detach( const libvlc_event_t * event, void
bool * callback_was_called = user_data; bool * callback_was_called = user_data;
libvlc_event_manager_t *em; libvlc_event_manager_t *em;
em = libvlc_media_player_event_manager (event->p_obj, &ex); em = libvlc_media_player_event_manager (event->p_obj);
catch();
libvlc_event_detach (em, event->type, test_events_callback_and_detach, user_data, &ex); libvlc_event_detach (em, event->type, test_events_callback_and_detach, user_data, &ex);
*callback_was_called = true; *callback_was_called = true;
...@@ -82,7 +81,7 @@ static void test_events (const char ** argv, int argc) ...@@ -82,7 +81,7 @@ static void test_events (const char ** argv, int argc)
mi = libvlc_media_player_new (vlc, &ex); mi = libvlc_media_player_new (vlc, &ex);
catch (); catch ();
em = libvlc_media_player_event_manager (mi, &ex); em = libvlc_media_player_event_manager (mi);
log ("+ Testing attaching to Media Instance\n"); log ("+ Testing attaching to Media Instance\n");
......
This diff is collapsed.
...@@ -50,22 +50,16 @@ static void test_media_player_play_stop(const char** argv, int argc) ...@@ -50,22 +50,16 @@ static void test_media_player_play_stop(const char** argv, int argc)
/* Wait a correct state */ /* Wait a correct state */
libvlc_state_t state; libvlc_state_t state;
do { do {
state = libvlc_media_player_get_state (mi, &ex); state = libvlc_media_player_get_state (mi);
catch ();
} while( state != libvlc_Playing && } while( state != libvlc_Playing &&
state != libvlc_Error && state != libvlc_Error &&
state != libvlc_Ended ); state != libvlc_Ended );
assert( state == libvlc_Playing || state == libvlc_Ended ); assert( state == libvlc_Playing || state == libvlc_Ended );
libvlc_media_player_stop (mi, &ex); libvlc_media_player_stop (mi);
catch ();
libvlc_media_player_release (mi); libvlc_media_player_release (mi);
catch ();
libvlc_release (vlc); libvlc_release (vlc);
catch ();
} }
static void test_media_player_pause_stop(const char** argv, int argc) 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) ...@@ -97,7 +91,7 @@ static void test_media_player_pause_stop(const char** argv, int argc)
/* Wait a correct state */ /* Wait a correct state */
libvlc_state_t state; libvlc_state_t state;
do { do {
state = libvlc_media_player_get_state (mi, &ex); state = libvlc_media_player_get_state (mi);
catch (); catch ();
} while( state != libvlc_Playing && } while( state != libvlc_Playing &&
state != libvlc_Error && state != libvlc_Error &&
...@@ -115,24 +109,17 @@ static void test_media_player_pause_stop(const char** argv, int argc) ...@@ -115,24 +109,17 @@ static void test_media_player_pause_stop(const char** argv, int argc)
/* Wait a correct state */ /* Wait a correct state */
do { do {
state = libvlc_media_player_get_state (mi, &ex); state = libvlc_media_player_get_state (mi);
catch ();
} while( state != libvlc_Paused && } while( state != libvlc_Paused &&
state != libvlc_Error && state != libvlc_Error &&
state != libvlc_Ended ); state != libvlc_Ended );
assert( state == libvlc_Paused || state == libvlc_Ended ); assert( state == libvlc_Paused || state == libvlc_Ended );
catch();
#endif #endif
libvlc_media_player_stop (mi, &ex); libvlc_media_player_stop (mi);
catch ();
libvlc_media_player_release (mi); libvlc_media_player_release (mi);
catch ();
libvlc_release (vlc); 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