libvlc_video: Save a few line in error case handling.

This commit is contained in:
Pierre d'Herbemont 2008-06-13 15:13:34 +02:00
parent 242309aa32
commit d5aaf6b271

View File

@ -336,8 +336,7 @@ char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *p_mi,
char *psz_aspect = 0; char *psz_aspect = 0;
vout_thread_t *p_vout = GetVout( p_mi, p_e ); vout_thread_t *p_vout = GetVout( p_mi, p_e );
if( !p_vout ) if( !p_vout ) return 0;
return 0;
psz_aspect = var_GetNonEmptyString( p_vout, "aspect-ratio" ); psz_aspect = var_GetNonEmptyString( p_vout, "aspect-ratio" );
vlc_object_release( p_vout ); vlc_object_release( p_vout );
@ -350,8 +349,7 @@ void libvlc_video_set_aspect_ratio( libvlc_media_player_t *p_mi,
vout_thread_t *p_vout = GetVout( p_mi, p_e ); vout_thread_t *p_vout = GetVout( p_mi, p_e );
int i_ret = -1; int i_ret = -1;
if( !p_vout ) if( !p_vout ) return;
return;
i_ret = var_SetString( p_vout, "aspect-ratio", psz_aspect ); i_ret = var_SetString( p_vout, "aspect-ratio", psz_aspect );
if( i_ret ) if( i_ret )
@ -371,8 +369,7 @@ int libvlc_video_get_spu( libvlc_media_player_t *p_mi,
int i_ret = -1; int i_ret = -1;
int i; int i;
if( !p_input_thread ) if( !p_input_thread ) return -1;
return -1;
i_ret = var_Get( p_input_thread, "spu-es", &val ); i_ret = var_Get( p_input_thread, "spu-es", &val );
if( i_ret < 0 ) if( i_ret < 0 )
@ -404,8 +401,7 @@ void libvlc_video_set_spu( libvlc_media_player_t *p_mi, int i_spu,
int i_ret = -1; int i_ret = -1;
int i; int i;
if( !p_input_thread ) if( !p_input_thread ) return;
return;
var_Change( p_input_thread, "spu-es", VLC_VAR_GETCHOICES, &val_list, NULL ); var_Change( p_input_thread, "spu-es", VLC_VAR_GETCHOICES, &val_list, NULL );
for( i = 0; i < val_list.p_list->i_count; i++ ) for( i = 0; i < val_list.p_list->i_count; i++ )
@ -451,8 +447,7 @@ char *libvlc_video_get_crop_geometry( libvlc_media_player_t *p_mi,
char *psz_geometry = 0; char *psz_geometry = 0;
vout_thread_t *p_vout = GetVout( p_mi, p_e ); vout_thread_t *p_vout = GetVout( p_mi, p_e );
if( !p_vout ) if( !p_vout ) return 0;
return 0;
psz_geometry = var_GetNonEmptyString( p_vout, "crop" ); psz_geometry = var_GetNonEmptyString( p_vout, "crop" );
vlc_object_release( p_vout ); vlc_object_release( p_vout );
@ -465,8 +460,7 @@ void libvlc_video_set_crop_geometry( libvlc_media_player_t *p_mi,
vout_thread_t *p_vout = GetVout( p_mi, p_e ); vout_thread_t *p_vout = GetVout( p_mi, p_e );
int i_ret = -1; int i_ret = -1;
if( !p_vout ) if( !p_vout ) return;
return;
i_ret = var_SetString( p_vout, "crop", psz_geometry ); i_ret = var_SetString( p_vout, "crop", psz_geometry );
if( i_ret ) if( i_ret )
@ -483,8 +477,7 @@ int libvlc_video_get_teletext( libvlc_media_player_t *p_mi,
vlc_object_t *p_vbi; vlc_object_t *p_vbi;
int i_ret = -1; int i_ret = -1;
if( !p_vout ) if( !p_vout ) return i_ret;
return i_ret;
p_vbi = (vlc_object_t *) vlc_object_find_name( p_vout, "zvbi", p_vbi = (vlc_object_t *) vlc_object_find_name( p_vout, "zvbi",
FIND_ANYWHERE ); FIND_ANYWHERE );
@ -505,8 +498,7 @@ void libvlc_video_set_teletext( libvlc_media_player_t *p_mi, int i_page,
vlc_object_t *p_vbi; vlc_object_t *p_vbi;
int i_ret = -1; int i_ret = -1;
if( !p_vout ) if( !p_vout ) return;
return;
p_vbi = (vlc_object_t *) vlc_object_find_name( p_vout, "zvbi", p_vbi = (vlc_object_t *) vlc_object_find_name( p_vout, "zvbi",
FIND_ANYWHERE ); FIND_ANYWHERE );