[vlc-devel] commit: libvlc_media_player_is_playing(): no need to throw an exception in this case. (Jean-Paul Saman )
git version control
git at videolan.org
Tue Mar 17 13:56:05 CET 2009
vlc | branch: master | Jean-Paul Saman <jean-paul.saman at m2x.nl> | Tue Mar 17 13:50:27 2009 +0100| [825f771dd5129a8584348911ade4a08fe855f31a] | committer: Jean-Paul Saman
libvlc_media_player_is_playing(): no need to throw an exception in this case.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=825f771dd5129a8584348911ade4a08fe855f31a
---
src/control/media_player.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/src/control/media_player.c b/src/control/media_player.c
index fc55345..8ab3b7f 100644
--- a/src/control/media_player.c
+++ b/src/control/media_player.c
@@ -607,7 +607,6 @@ void libvlc_media_player_play( libvlc_media_player_t *p_mi,
p_mi->p_input_thread = input_CreateThread(
p_mi->p_libvlc_instance->p_libvlc_int, p_mi->p_md->p_input_item );
-
if( !p_mi->p_input_thread )
{
vlc_mutex_unlock( &p_mi->object_lock );
@@ -671,7 +670,12 @@ int libvlc_media_player_is_playing( libvlc_media_player_t *p_mi,
input_thread_t * p_input_thread = libvlc_get_input_thread( p_mi, p_e );
if( !p_input_thread )
+ {
+ /* We do return the right value, no need to throw an exception */
+ if( libvlc_exception_raised( p_e ) )
+ libvlc_exception_clear( p_e );
return 0;
+ }
libvlc_state_t state = libvlc_media_player_get_state( p_mi, p_e );
@@ -720,6 +724,7 @@ void libvlc_media_player_stop( libvlc_media_player_t *p_mi,
input_StopThread( p_input_thread, true );
vlc_object_release( p_input_thread );
+ p_mi->p_input_thread = NULL;
}
}
More information about the vlc-devel
mailing list