]> git.sesse.net Git - vlc/commitdiff
- control/input.c: don't rely on exceptions to control the state of API internal...
authorDamien Fouilleul <damienf@videolan.org>
Tue, 27 Mar 2007 19:01:51 +0000 (19:01 +0000)
committerDamien Fouilleul <damienf@videolan.org>
Tue, 27 Mar 2007 19:01:51 +0000 (19:01 +0000)
src/control/input.c

index 9e9668a9f4175f249ff2abf9f74778ec7e48fc6e..1dbcb6a8d9662706c2930058d4a8e8c7eb99b526 100644 (file)
@@ -64,7 +64,7 @@ vlc_int64_t libvlc_input_get_length( libvlc_input_t *p_input,
     vlc_value_t val;
 
     p_input_thread = libvlc_get_input_thread ( p_input, p_e);
-    if( libvlc_exception_raised( p_e ) )
+    if( !p_input_thread )
         return -1;
 
     var_Get( p_input_thread, "length", &val );
@@ -80,7 +80,7 @@ vlc_int64_t libvlc_input_get_time( libvlc_input_t *p_input,
     vlc_value_t val;
 
     p_input_thread = libvlc_get_input_thread ( p_input, p_e );
-    if( libvlc_exception_raised( p_e ) )
+    if( !p_input_thread )
         return -1;
 
     var_Get( p_input_thread , "time", &val );
@@ -95,7 +95,7 @@ void libvlc_input_set_time( libvlc_input_t *p_input, vlc_int64_t time,
     vlc_value_t value;
 
     p_input_thread = libvlc_get_input_thread ( p_input, p_e );
-    if( libvlc_exception_raised( p_e ) )
+    if( !p_input_thread )
         return;
 
     value.i_time = time*1000LL;
@@ -111,7 +111,7 @@ void libvlc_input_set_position( libvlc_input_t *p_input, float position,
     val.f_float = position;
 
     p_input_thread = libvlc_get_input_thread ( p_input, p_e);
-    if ( libvlc_exception_raised( p_e ) )
+    if( !p_input_thread )
         return;
 
     var_Set( p_input_thread, "position", val );
@@ -125,7 +125,7 @@ float libvlc_input_get_position( libvlc_input_t *p_input,
     vlc_value_t val;
 
     p_input_thread = libvlc_get_input_thread ( p_input, p_e);
-    if ( libvlc_exception_raised( p_e ) )
+    if( !p_input_thread )
         return -1.0;
 
     var_Get( p_input_thread, "position", &val );
@@ -141,7 +141,7 @@ float libvlc_input_get_fps( libvlc_input_t *p_input,
     input_thread_t *p_input_thread;
 
     p_input_thread = libvlc_get_input_thread ( p_input, p_e );
-    if ( libvlc_exception_raised( p_e ) )
+    if( !p_input_thread )
         return 0.0;
 
     if( (NULL == p_input_thread->p->input.p_demux)
@@ -163,7 +163,7 @@ vlc_bool_t libvlc_input_will_play( libvlc_input_t *p_input,
 {
     input_thread_t *p_input_thread =
                             libvlc_get_input_thread ( p_input, p_e);
-    if ( libvlc_exception_raised( p_e ) )
+    if ( !p_input_thread )
         return VLC_FALSE;
 
     if ( !p_input_thread->b_die && !p_input_thread->b_dead ) 
@@ -187,7 +187,7 @@ void libvlc_input_set_rate( libvlc_input_t *p_input, float rate,
     val.i_int = 1000.0f/rate;
 
     p_input_thread = libvlc_get_input_thread ( p_input, p_e);
-    if ( libvlc_exception_raised( p_e ) )
+    if ( !p_input_thread )
         return;
 
     var_Set( p_input_thread, "rate", val );
@@ -201,7 +201,7 @@ float libvlc_input_get_rate( libvlc_input_t *p_input,
     vlc_value_t val;
 
     p_input_thread = libvlc_get_input_thread ( p_input, p_e);
-    if ( libvlc_exception_raised( p_e ) )
+    if ( !p_input_thread )
         return -1.0;
 
     var_Get( p_input_thread, "rate", &val );
@@ -217,7 +217,7 @@ int libvlc_input_get_state( libvlc_input_t *p_input,
     vlc_value_t val;
 
     p_input_thread = libvlc_get_input_thread ( p_input, p_e );
-    if ( libvlc_exception_raised( p_e ) )
+    if ( !p_input_thread )
         return 0;
 
     var_Get( p_input_thread, "state", &val );