From 63f556158dfe9a76c0c1d6158fb87d20a3a4416c Mon Sep 17 00:00:00 2001 From: Damien Fouilleul Date: Mon, 5 Mar 2007 00:09:53 +0000 Subject: [PATCH] - control APIs: do not crash if exception parameter is null, that means caller is not interested in exceptions --- src/control/core.c | 2 +- src/control/video.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/control/core.c b/src/control/core.c index eba0c8c93f..3f7cc9aa19 100644 --- a/src/control/core.c +++ b/src/control/core.c @@ -45,7 +45,7 @@ void libvlc_exception_clear( libvlc_exception_t *p_exception ) inline int libvlc_exception_raised( libvlc_exception_t *p_exception ) { - return p_exception->b_raised; + return (NULL != p_exception) && p_exception->b_raised; } inline char* libvlc_exception_get_message( libvlc_exception_t *p_exception ) diff --git a/src/control/video.c b/src/control/video.c index 8adac83d14..326fa301dc 100644 --- a/src/control/video.c +++ b/src/control/video.c @@ -197,9 +197,10 @@ vlc_bool_t libvlc_input_has_vout( libvlc_input_t *p_input, libvlc_exception_t *p_e ) { vout_thread_t *p_vout = GetVout( p_input, p_e ); - if ( libvlc_exception_raised( p_e ) ) + if ( NULL == p_vout ) { - if ( strcmp( "No active video output", libvlc_exception_get_message( p_e ) ) == 0 ) + if ( libvlc_exception_raised( p_e ) + && strcmp( "No active video output", libvlc_exception_get_message( p_e ) ) == 0 ) { libvlc_exception_clear( p_e ); } -- 2.39.2