Commit 63f55615 authored by Damien Fouilleul's avatar Damien Fouilleul

- control APIs: do not crash if exception parameter is null, that means caller...

- control APIs: do not crash if exception parameter is null, that means caller is not interested in exceptions
parent 41684503
...@@ -45,7 +45,7 @@ void libvlc_exception_clear( libvlc_exception_t *p_exception ) ...@@ -45,7 +45,7 @@ void libvlc_exception_clear( libvlc_exception_t *p_exception )
inline int libvlc_exception_raised( 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 ) inline char* libvlc_exception_get_message( libvlc_exception_t *p_exception )
......
...@@ -197,9 +197,10 @@ vlc_bool_t libvlc_input_has_vout( libvlc_input_t *p_input, ...@@ -197,9 +197,10 @@ vlc_bool_t libvlc_input_has_vout( libvlc_input_t *p_input,
libvlc_exception_t *p_e ) libvlc_exception_t *p_e )
{ {
vout_thread_t *p_vout = GetVout( p_input, 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 ); libvlc_exception_clear( p_e );
} }
......
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