1
mirror of https://code.videolan.org/videolan/vlc synced 2024-09-24 20:48:52 +02:00

Readibility cleanup

This commit is contained in:
Jean-Paul Saman 2006-10-29 09:35:43 +00:00
parent 4a80777b4e
commit 3b86ec1d20
2 changed files with 35 additions and 31 deletions

View File

@ -41,18 +41,19 @@ input_thread_t *libvlc_get_input_thread( libvlc_input_t *p_input,
{
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->p_instance->p_libvlc_int,
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;
}
/**************************************************************************
* Getters for stream information
**************************************************************************/
@ -63,7 +64,8 @@ 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 ) ) return -1;
if( libvlc_exception_raised( p_e ) )
return -1;
var_Get( p_input_thread, "length", &val );
vlc_object_release( p_input_thread );
@ -78,7 +80,8 @@ 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 ) ) return -1;
if( libvlc_exception_raised( p_e ) )
return -1;
var_Get( p_input_thread , "time", &val );
vlc_object_release( p_input_thread );
@ -92,7 +95,8 @@ 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 ) ) return;
if( libvlc_exception_raised( p_e ) )
return;
value.i_time = time*1000LL;
var_Set( p_input_thread, "time", value );
@ -107,7 +111,8 @@ 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 ) ) return;
if ( libvlc_exception_raised( p_e ) )
return;
var_Set( p_input_thread, "position", val );
vlc_object_release( p_input_thread );
@ -120,7 +125,8 @@ 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 ) ) return -1.0;
if ( libvlc_exception_raised( p_e ) )
return -1.0;
var_Get( p_input_thread, "position", &val );
vlc_object_release( p_input_thread );
@ -135,7 +141,8 @@ 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 ) ) 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 )
|| f_fps < 0.1 )
@ -155,7 +162,8 @@ 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 ) ) return VLC_FALSE;
if ( libvlc_exception_raised( p_e ) )
return VLC_FALSE;
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,
val.i_int = 1000.0f/rate;
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 );
vlc_object_release( p_input_thread );
@ -191,7 +200,8 @@ 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 ) ) return -1.0;
if ( libvlc_exception_raised( p_e ) )
return -1.0;
var_Get( p_input_thread, "rate", &val );
vlc_object_release( p_input_thread );
@ -206,7 +216,8 @@ 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 ) ) return 0;
if ( libvlc_exception_raised( p_e ) )
return 0;
var_Get( p_input_thread, "state", &val );
vlc_object_release( p_input_thread );

View File

@ -5,7 +5,7 @@
*
* $Id: core.c 14187 2006-02-07 16:37:40Z courmisch $
*
* Authors: Clément Stenac <zorglub@videolan.org>
* Authors: Cl<EFBFBD>ent Stenac <zorglub@videolan.org>
* Filippo Carone <littlejohn@videolan.org>
*
* 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,
"Unexpected error while setting fullscreen value" );
vlc_object_release( p_vout1 );
}
int libvlc_get_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" );
vlc_object_release( p_vout1 );
}
void
@ -170,9 +168,6 @@ libvlc_video_take_snapshot( libvlc_input_t *p_input, char *psz_filepath,
vout_Control( p_vout, VOUT_SNAPSHOT );
vlc_object_release( p_vout );
vlc_object_release( p_input_thread );
return;
}
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,
vlc_object_release( p_vout );
return 0;
}
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,
vout_Destroy( p_vout );
return 0;
}