Commit 3b86ec1d authored by Jean-Paul Saman's avatar Jean-Paul Saman

Readibility cleanup

parent 4a80777b
...@@ -41,18 +41,19 @@ input_thread_t *libvlc_get_input_thread( libvlc_input_t *p_input, ...@@ -41,18 +41,19 @@ input_thread_t *libvlc_get_input_thread( libvlc_input_t *p_input,
{ {
input_thread_t *p_input_thread; input_thread_t *p_input_thread;
if( !p_input ) RAISENULL( "Input is NULL" ); if( !p_input )
RAISENULL( "Input is NULL" );
p_input_thread = (input_thread_t*)vlc_object_get( p_input_thread = (input_thread_t*)vlc_object_get(
p_input->p_instance->p_libvlc_int, p_input->p_instance->p_libvlc_int,
p_input->i_input_id ); p_input->i_input_id );
if( !p_input_thread ) RAISENULL( "Input does not exist" ); if( !p_input_thread )
RAISENULL( "Input does not exist" );
return p_input_thread; return p_input_thread;
} }
/************************************************************************** /**************************************************************************
* Getters for stream information * Getters for stream information
**************************************************************************/ **************************************************************************/
...@@ -63,7 +64,8 @@ vlc_int64_t libvlc_input_get_length( libvlc_input_t *p_input, ...@@ -63,7 +64,8 @@ vlc_int64_t libvlc_input_get_length( libvlc_input_t *p_input,
vlc_value_t val; vlc_value_t val;
p_input_thread = libvlc_get_input_thread ( p_input, p_e); p_input_thread = libvlc_get_input_thread ( p_input, p_e);
if( libvlc_exception_raised( p_e ) ) return -1; if( libvlc_exception_raised( p_e ) )
return -1;
var_Get( p_input_thread, "length", &val ); var_Get( p_input_thread, "length", &val );
vlc_object_release( p_input_thread ); vlc_object_release( p_input_thread );
...@@ -78,7 +80,8 @@ vlc_int64_t libvlc_input_get_time( libvlc_input_t *p_input, ...@@ -78,7 +80,8 @@ vlc_int64_t libvlc_input_get_time( libvlc_input_t *p_input,
vlc_value_t val; vlc_value_t val;
p_input_thread = libvlc_get_input_thread ( p_input, p_e ); p_input_thread = libvlc_get_input_thread ( p_input, p_e );
if( libvlc_exception_raised( p_e ) ) return -1; if( libvlc_exception_raised( p_e ) )
return -1;
var_Get( p_input_thread , "time", &val ); var_Get( p_input_thread , "time", &val );
vlc_object_release( p_input_thread ); vlc_object_release( p_input_thread );
...@@ -92,7 +95,8 @@ void libvlc_input_set_time( libvlc_input_t *p_input, vlc_int64_t time, ...@@ -92,7 +95,8 @@ void libvlc_input_set_time( libvlc_input_t *p_input, vlc_int64_t time,
vlc_value_t value; vlc_value_t value;
p_input_thread = libvlc_get_input_thread ( p_input, p_e ); p_input_thread = libvlc_get_input_thread ( p_input, p_e );
if( libvlc_exception_raised( p_e ) ) return; if( libvlc_exception_raised( p_e ) )
return;
value.i_time = time*1000LL; value.i_time = time*1000LL;
var_Set( p_input_thread, "time", value ); var_Set( p_input_thread, "time", value );
...@@ -107,7 +111,8 @@ void libvlc_input_set_position( libvlc_input_t *p_input, float position, ...@@ -107,7 +111,8 @@ void libvlc_input_set_position( libvlc_input_t *p_input, float position,
val.f_float = position; val.f_float = position;
p_input_thread = libvlc_get_input_thread ( p_input, p_e); p_input_thread = libvlc_get_input_thread ( p_input, p_e);
if ( libvlc_exception_raised( p_e ) ) return; if ( libvlc_exception_raised( p_e ) )
return;
var_Set( p_input_thread, "position", val ); var_Set( p_input_thread, "position", val );
vlc_object_release( p_input_thread ); vlc_object_release( p_input_thread );
...@@ -120,7 +125,8 @@ float libvlc_input_get_position( libvlc_input_t *p_input, ...@@ -120,7 +125,8 @@ float libvlc_input_get_position( libvlc_input_t *p_input,
vlc_value_t val; vlc_value_t val;
p_input_thread = libvlc_get_input_thread ( p_input, p_e); p_input_thread = libvlc_get_input_thread ( p_input, p_e);
if ( libvlc_exception_raised( p_e ) ) return -1.0; if ( libvlc_exception_raised( p_e ) )
return -1.0;
var_Get( p_input_thread, "position", &val ); var_Get( p_input_thread, "position", &val );
vlc_object_release( p_input_thread ); vlc_object_release( p_input_thread );
...@@ -135,7 +141,8 @@ float libvlc_input_get_fps( libvlc_input_t *p_input, ...@@ -135,7 +141,8 @@ float libvlc_input_get_fps( libvlc_input_t *p_input,
input_thread_t *p_input_thread; input_thread_t *p_input_thread;
p_input_thread = libvlc_get_input_thread ( p_input, p_e ); p_input_thread = libvlc_get_input_thread ( p_input, p_e );
if ( libvlc_exception_raised( p_e ) ) return 0.0; if ( libvlc_exception_raised( p_e ) )
return 0.0;
if( demux2_Control( p_input_thread->input.p_demux, DEMUX_GET_FPS, &f_fps ) if( demux2_Control( p_input_thread->input.p_demux, DEMUX_GET_FPS, &f_fps )
|| f_fps < 0.1 ) || f_fps < 0.1 )
...@@ -155,7 +162,8 @@ vlc_bool_t libvlc_input_will_play( libvlc_input_t *p_input, ...@@ -155,7 +162,8 @@ vlc_bool_t libvlc_input_will_play( libvlc_input_t *p_input,
{ {
input_thread_t *p_input_thread = input_thread_t *p_input_thread =
libvlc_get_input_thread ( p_input, p_e); libvlc_get_input_thread ( p_input, p_e);
if ( libvlc_exception_raised( p_e ) ) return VLC_FALSE; if ( libvlc_exception_raised( p_e ) )
return VLC_FALSE;
if ( !p_input_thread->b_die && !p_input_thread->b_dead ) if ( !p_input_thread->b_die && !p_input_thread->b_dead )
{ {
...@@ -178,7 +186,8 @@ void libvlc_input_set_rate( libvlc_input_t *p_input, float rate, ...@@ -178,7 +186,8 @@ void libvlc_input_set_rate( libvlc_input_t *p_input, float rate,
val.i_int = 1000.0f/rate; val.i_int = 1000.0f/rate;
p_input_thread = libvlc_get_input_thread ( p_input, p_e); p_input_thread = libvlc_get_input_thread ( p_input, p_e);
if ( libvlc_exception_raised( p_e ) ) return; if ( libvlc_exception_raised( p_e ) )
return;
var_Set( p_input_thread, "rate", val ); var_Set( p_input_thread, "rate", val );
vlc_object_release( p_input_thread ); vlc_object_release( p_input_thread );
...@@ -191,7 +200,8 @@ float libvlc_input_get_rate( libvlc_input_t *p_input, ...@@ -191,7 +200,8 @@ float libvlc_input_get_rate( libvlc_input_t *p_input,
vlc_value_t val; vlc_value_t val;
p_input_thread = libvlc_get_input_thread ( p_input, p_e); p_input_thread = libvlc_get_input_thread ( p_input, p_e);
if ( libvlc_exception_raised( p_e ) ) return -1.0; if ( libvlc_exception_raised( p_e ) )
return -1.0;
var_Get( p_input_thread, "rate", &val ); var_Get( p_input_thread, "rate", &val );
vlc_object_release( p_input_thread ); vlc_object_release( p_input_thread );
...@@ -206,7 +216,8 @@ int libvlc_input_get_state( libvlc_input_t *p_input, ...@@ -206,7 +216,8 @@ int libvlc_input_get_state( libvlc_input_t *p_input,
vlc_value_t val; vlc_value_t val;
p_input_thread = libvlc_get_input_thread ( p_input, p_e); p_input_thread = libvlc_get_input_thread ( p_input, p_e);
if ( libvlc_exception_raised( p_e ) ) return 0; if ( libvlc_exception_raised( p_e ) )
return 0;
var_Get( p_input_thread, "state", &val ); var_Get( p_input_thread, "state", &val );
vlc_object_release( p_input_thread ); vlc_object_release( p_input_thread );
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* *
* $Id: core.c 14187 2006-02-07 16:37:40Z courmisch $ * $Id: core.c 14187 2006-02-07 16:37:40Z courmisch $
* *
* Authors: Clment Stenac <zorglub@videolan.org> * Authors: Clent Stenac <zorglub@videolan.org>
* Filippo Carone <littlejohn@videolan.org> * Filippo Carone <littlejohn@videolan.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -91,7 +91,6 @@ void libvlc_set_fullscreen( libvlc_input_t *p_input, int b_fullscreen, ...@@ -91,7 +91,6 @@ void libvlc_set_fullscreen( libvlc_input_t *p_input, int b_fullscreen,
"Unexpected error while setting fullscreen value" ); "Unexpected error while setting fullscreen value" );
vlc_object_release( p_vout1 ); vlc_object_release( p_vout1 );
} }
int libvlc_get_fullscreen( libvlc_input_t *p_input, int libvlc_get_fullscreen( libvlc_input_t *p_input,
...@@ -136,7 +135,6 @@ void libvlc_toggle_fullscreen( libvlc_input_t *p_input, ...@@ -136,7 +135,6 @@ void libvlc_toggle_fullscreen( libvlc_input_t *p_input,
"Unexpected error while setting fullscreen value" ); "Unexpected error while setting fullscreen value" );
vlc_object_release( p_vout1 ); vlc_object_release( p_vout1 );
} }
void void
...@@ -170,9 +168,6 @@ libvlc_video_take_snapshot( libvlc_input_t *p_input, char *psz_filepath, ...@@ -170,9 +168,6 @@ libvlc_video_take_snapshot( libvlc_input_t *p_input, char *psz_filepath,
vout_Control( p_vout, VOUT_SNAPSHOT ); vout_Control( p_vout, VOUT_SNAPSHOT );
vlc_object_release( p_vout ); vlc_object_release( p_vout );
vlc_object_release( p_input_thread ); vlc_object_release( p_input_thread );
return;
} }
int libvlc_video_get_height( libvlc_input_t *p_input, int libvlc_video_get_height( libvlc_input_t *p_input,
...@@ -224,7 +219,6 @@ int libvlc_video_reparent( libvlc_input_t *p_input, libvlc_drawable_t d, ...@@ -224,7 +219,6 @@ int libvlc_video_reparent( libvlc_input_t *p_input, libvlc_drawable_t d,
vlc_object_release( p_vout ); vlc_object_release( p_vout );
return 0; return 0;
} }
void libvlc_video_resize( libvlc_input_t *p_input, int width, int height, libvlc_exception_t *p_e ) void libvlc_video_resize( libvlc_input_t *p_input, int width, int height, libvlc_exception_t *p_e )
...@@ -334,5 +328,4 @@ int libvlc_video_destroy( libvlc_input_t *p_input, ...@@ -334,5 +328,4 @@ int libvlc_video_destroy( libvlc_input_t *p_input,
vout_Destroy( p_vout ); vout_Destroy( p_vout );
return 0; return 0;
} }
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