Commit 2a8ef11d authored by Sam Hocevar's avatar Sam Hocevar

(previous commit foired)

 . this is a coding style patch which removes all "foo(bar){" constructions
   and most of the tabulations.
 . also, fixed a bug in the default subtitle track.
 . and made a few error messages more explicit, ie. changed "error: %s" to
   "foo error: couldn't initialize bar (%s)"
 . and removed a warning in intf_ctrl.c which isn't used anyway.
parent a132d75c
...@@ -498,8 +498,8 @@ static int SpawnInput( int i_argc, intf_arg_t *p_argv ) ...@@ -498,8 +498,8 @@ static int SpawnInput( int i_argc, intf_arg_t *p_argv )
p_main->p_intf->p_input = input_CreateThread( i_method, p_source, i_port, i_vlan_id, p_main->p_intf->p_input = input_CreateThread( i_method, p_source, i_port, i_vlan_id,
p_main->p_intf->p_vout, p_main->p_aout, p_main->p_intf->p_vout, p_main->p_aout,
NULL ); NULL );
return( INTF_NO_ERROR );
#endif #endif
return( INTF_NO_ERROR );
} }
/***************************************************************************** /*****************************************************************************
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* lpcm_decoder_thread.c: lpcm decoder thread * lpcm_decoder_thread.c: lpcm decoder thread
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: lpcm_decoder_thread.c,v 1.7 2000/12/27 18:35:45 massiot Exp $ * $Id: lpcm_decoder_thread.c,v 1.8 2001/01/05 14:46:37 sam Exp $
* *
* Authors: * Authors:
* *
...@@ -66,11 +66,11 @@ static void EndThread (lpcmdec_thread_t * p_adec); ...@@ -66,11 +66,11 @@ static void EndThread (lpcmdec_thread_t * p_adec);
vlc_thread_t lpcmdec_CreateThread (adec_config_t * p_config) vlc_thread_t lpcmdec_CreateThread (adec_config_t * p_config)
{ {
lpcmdec_thread_t * p_lpcmdec; lpcmdec_thread_t * p_lpcmdec;
intf_DbgMsg ( "LPCM Debug: creating lpcm decoder thread" ); intf_DbgMsg ( "lpcm: creating lpcm decoder thread" );
/* Allocate the memory needed to store the thread's structure */ /* Allocate the memory needed to store the thread's structure */
if ((p_lpcmdec = (lpcmdec_thread_t *)malloc (sizeof(lpcmdec_thread_t))) == NULL) { if ((p_lpcmdec = (lpcmdec_thread_t *)malloc (sizeof(lpcmdec_thread_t))) == NULL) {
intf_ErrMsg ( "LPCM Error: not enough memory for lpcmdec_CreateThread() to create the new thread" ); intf_ErrMsg ( "lpcm error: cannot create lpcmdec_thread_t" );
return 0; return 0;
} }
...@@ -92,7 +92,7 @@ vlc_thread_t lpcmdec_CreateThread (adec_config_t * p_config) ...@@ -92,7 +92,7 @@ vlc_thread_t lpcmdec_CreateThread (adec_config_t * p_config)
/* Spawn the lpcm decoder thread */ /* Spawn the lpcm decoder thread */
if (vlc_thread_create(&p_lpcmdec->thread_id, "lpcm decoder", (vlc_thread_func_t)RunThread, (void *)p_lpcmdec)) { if (vlc_thread_create(&p_lpcmdec->thread_id, "lpcm decoder", (vlc_thread_func_t)RunThread, (void *)p_lpcmdec)) {
intf_ErrMsg ( "LPCM Error: can't spawn lpcm decoder thread" ); intf_ErrMsg ( "lpcm error: cannot spawn thread" );
free (p_lpcmdec); free (p_lpcmdec);
return 0; return 0;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* lpcm_decoder_thread.h : lpcm decoder thread interface * lpcm_decoder_thread.h : lpcm decoder thread interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: lpcm_decoder_thread.h,v 1.2 2000/12/21 13:25:51 massiot Exp $ * $Id: lpcm_decoder_thread.h,v 1.3 2001/01/05 14:46:37 sam Exp $
* *
* Authors: * Authors:
* *
......
...@@ -94,7 +94,7 @@ int BuildInetAddr( struct sockaddr_in *p_sa_in, char *psz_in_addr, int i_port ) ...@@ -94,7 +94,7 @@ int BuildInetAddr( struct sockaddr_in *p_sa_in, char *psz_in_addr, int i_port )
intf_DbgMsg("debug: resolving internet address %s...", psz_in_addr); intf_DbgMsg("debug: resolving internet address %s...", psz_in_addr);
if ( (p_hostent = gethostbyname(psz_in_addr)) == NULL) if ( (p_hostent = gethostbyname(psz_in_addr)) == NULL)
{ {
intf_ErrMsg("error: unknown host %s", psz_in_addr); intf_ErrMsg( "net error: unknown host %s", psz_in_addr );
return( -1 ); return( -1 );
} }
...@@ -158,8 +158,8 @@ int ReadIfConf(int i_sockfd, if_descr_t* p_ifdescr, char* psz_name) ...@@ -158,8 +158,8 @@ int ReadIfConf(int i_sockfd, if_descr_t* p_ifdescr, char* psz_name)
} }
else else
{ {
intf_ErrMsg("Cannot read flags for interface %s: %s", psz_name, intf_ErrMsg( "net error: cannot read flags for interface %s (%s)",
strerror(errno)); psz_name, strerror(errno) );
return -1; return -1;
} }
...@@ -182,8 +182,8 @@ int ReadIfConf(int i_sockfd, if_descr_t* p_ifdescr, char* psz_name) ...@@ -182,8 +182,8 @@ int ReadIfConf(int i_sockfd, if_descr_t* p_ifdescr, char* psz_name)
} }
else else
{ {
intf_ErrMsg("Cannot read hardware address for interface %s: %s", intf_ErrMsg( "net error: cannot read hardware address for %s (%s)",
psz_name, strerror(errno)); psz_name, strerror(errno) );
return -1; return -1;
} }
...@@ -197,8 +197,8 @@ int ReadIfConf(int i_sockfd, if_descr_t* p_ifdescr, char* psz_name) ...@@ -197,8 +197,8 @@ int ReadIfConf(int i_sockfd, if_descr_t* p_ifdescr, char* psz_name)
} }
else else
{ {
intf_ErrMsg("Cannot read network address for interface %s: %s", intf_ErrMsg( "net error: cannot read network address for %s (%s)",
psz_name, strerror(errno)); psz_name, strerror(errno) );
return -1; return -1;
} }
...@@ -221,7 +221,7 @@ int ReadIfConf(int i_sockfd, if_descr_t* p_ifdescr, char* psz_name) ...@@ -221,7 +221,7 @@ int ReadIfConf(int i_sockfd, if_descr_t* p_ifdescr, char* psz_name)
} }
else else
{ {
intf_ErrMsg("Cannot read broadcast address for interface %s: %s", intf_ErrMsg( "net error: cannot read broadcast address for %s (%s)",
psz_name, strerror(errno)); psz_name, strerror(errno));
return -1; return -1;
} }
...@@ -267,7 +267,7 @@ int ReadNetConf(int i_sockfd, net_descr_t* p_net_descr) ...@@ -267,7 +267,7 @@ int ReadNetConf(int i_sockfd, net_descr_t* p_net_descr)
i_rc = ioctl(i_sockfd, SIOCGIFCONF, (byte_t*)&ifc_netconf); i_rc = ioctl(i_sockfd, SIOCGIFCONF, (byte_t*)&ifc_netconf);
if( i_rc ) if( i_rc )
{ {
intf_ErrMsg("Cannot read network configuration: %s", intf_ErrMsg( "net error: cannot read network configuration (%s)",
strerror(errno)); strerror(errno));
break; break;
} }
...@@ -298,8 +298,8 @@ int ReadNetConf(int i_sockfd, net_descr_t* p_net_descr) ...@@ -298,8 +298,8 @@ int ReadNetConf(int i_sockfd, net_descr_t* p_net_descr)
/* Read the status of this interface */ /* Read the status of this interface */
if( ioctl(i_sockfd, SIOCGIFFLAGS, (byte_t *)p_ifr_current_if) < 0 ) if( ioctl(i_sockfd, SIOCGIFFLAGS, (byte_t *)p_ifr_current_if) < 0 )
{ {
intf_ErrMsg("Cannot access interface %s: %s", intf_ErrMsg( "net error: cannot access interface %s (%s)",
p_ifr_current_if->ifr_name, strerror(errno)); p_ifr_current_if->ifr_name, strerror(errno) );
i_rc = -1; i_rc = -1;
break; break;
} }
......
...@@ -54,14 +54,14 @@ playlist_t * playlist_Create ( void ) ...@@ -54,14 +54,14 @@ playlist_t * playlist_Create ( void )
p_playlist->i_index = 0; p_playlist->i_index = 0;
p_playlist->p_list = NULL; p_playlist->p_list = NULL;
intf_Msg("Playlist initialized"); intf_Msg("Playlist created");
return( p_playlist ); return( p_playlist );
} }
void playlist_Init( playlist_t * p_playlist, int i_optind ) void playlist_Init( playlist_t * p_playlist, int i_optind )
{ {
int i_list_index = 0; int i_list_index = 0;
int i_index = 0; int i_index;
int i_argc = p_main->i_argc; int i_argc = p_main->i_argc;
if( i_optind < i_argc ) if( i_optind < i_argc )
...@@ -70,11 +70,17 @@ void playlist_Init( playlist_t * p_playlist, int i_optind ) ...@@ -70,11 +70,17 @@ void playlist_Init( playlist_t * p_playlist, int i_optind )
p_playlist->p_list = malloc( i_list_index * sizeof( int ) ); p_playlist->p_list = malloc( i_list_index * sizeof( int ) );
while( i_argc - i_index > i_optind ) for( i_index = 0 ; i_argc - i_index > i_optind ; i_index++ )
{
if( strncmp( p_main->ppsz_argv[ i_argc - i_index - 1], "-", 1 ) )
{ {
p_playlist->p_list[ i_index ] = p_playlist->p_list[ i_index ] =
p_main->ppsz_argv[ i_argc - i_index - 1]; p_main->ppsz_argv[ i_argc - i_index - 1];
i_index++; }
else
{
p_playlist->p_list[ i_index ] = "/dev/stdin";
}
} }
} }
else else
......
...@@ -115,6 +115,7 @@ void bank_Init( plugin_bank_t * p_bank ) ...@@ -115,6 +115,7 @@ void bank_Init( plugin_bank_t * p_bank )
/* Dummy plugin */ /* Dummy plugin */
SEEK_PLUGIN( "dummy" ); SEEK_PLUGIN( "dummy" );
SEEK_PLUGIN( "null" );
#undef SEEK_PLUGIN #undef SEEK_PLUGIN
} }
...@@ -190,7 +191,7 @@ char * TestPlugin ( plugin_id_t *p_plugin_id, char * psz_name ) ...@@ -190,7 +191,7 @@ char * TestPlugin ( plugin_id_t *p_plugin_id, char * psz_name )
} }
#ifndef SYS_BEOS #ifndef SYS_BEOS
intf_WarnMsg( 1, "Plugin %s failed: %s", psz_plugin, dlerror() ); intf_ErrMsg( "plugin error: cannot open %s (%s)", psz_plugin, dlerror() );
#endif #endif
free( psz_plugin ); free( psz_plugin );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vdec_idctmmx.S : MMX IDCT implementation * vdec_idctmmx.S : MMX IDCT implementation
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: vdec_idctmmx.S,v 1.5 2000/12/21 17:19:52 massiot Exp $ * $Id: vdec_idctmmx.S,v 1.6 2001/01/05 14:46:37 sam Exp $
* *
* Authors: * Authors:
* *
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vdec_motion.c : motion compensation routines * vdec_motion.c : motion compensation routines
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: vdec_motion.c,v 1.33 2000/12/22 13:04:45 sam Exp $ * $Id: vdec_motion.c,v 1.34 2001/01/05 14:46:37 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Jean-Marc Dressler <polux@via.ecp.fr> * Jean-Marc Dressler <polux@via.ecp.fr>
...@@ -136,12 +136,12 @@ static __inline__ void MotionComponent( ...@@ -136,12 +136,12 @@ static __inline__ void MotionComponent(
boolean_t b_average /* (explicit) averaging of several boolean_t b_average /* (explicit) averaging of several
* predictions */ ) * predictions */ )
{ {
___callTheRightOne (16,16) ___callTheRightOne (16,16)
___callTheRightOne (16,8) ___callTheRightOne (16,8)
___callTheRightOne (8,8) ___callTheRightOne (8,8)
___callTheRightOne (8,4) ___callTheRightOne (8,4)
#if 0 #if 0
___callTheRightOne (8,16) ___callTheRightOne (8,16)
#endif #endif
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vdec_motion_inner.c : motion compensation inner routines * vdec_motion_inner.c : motion compensation inner routines
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: vdec_motion_inner.c,v 1.10 2000/12/21 17:19:52 massiot Exp $ * $Id: vdec_motion_inner.c,v 1.11 2001/01/05 14:46:37 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Jean-Marc Dressler <polux@via.ecp.fr> * Jean-Marc Dressler <polux@via.ecp.fr>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* MMX * MMX
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: vdec_motion_inner_mmx.c,v 1.5 2000/12/21 17:19:52 massiot Exp $ * $Id: vdec_motion_inner_mmx.c,v 1.6 2001/01/05 14:46:37 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr>, largerly inspired by the * Authors: Christophe Massiot <massiot@via.ecp.fr>, largerly inspired by the
* work done by the livid project <http://www.linuxvideo.org/> * work done by the livid project <http://www.linuxvideo.org/>
......
...@@ -104,7 +104,8 @@ vout_thread_t * vout_CreateThread ( char *psz_display, int i_root_window, ...@@ -104,7 +104,8 @@ vout_thread_t * vout_CreateThread ( char *psz_display, int i_root_window,
p_vout = (vout_thread_t *) malloc( sizeof(vout_thread_t) ); p_vout = (vout_thread_t *) malloc( sizeof(vout_thread_t) );
if( p_vout == NULL ) if( p_vout == NULL )
{ {
intf_ErrMsg( "vout error: %s", strerror(ENOMEM) ); intf_ErrMsg( "vout error: vout thread creation returned %s",
strerror(ENOMEM) );
return( NULL ); return( NULL );
} }
...@@ -460,7 +461,8 @@ subpicture_t *vout_CreateSubPicture( vout_thread_t *p_vout, int i_type, ...@@ -460,7 +461,8 @@ subpicture_t *vout_CreateSubPicture( vout_thread_t *p_vout, int i_type,
p_free_subpic->i_type = EMPTY_SUBPICTURE; p_free_subpic->i_type = EMPTY_SUBPICTURE;
p_free_subpic->i_status = FREE_SUBPICTURE; p_free_subpic->i_status = FREE_SUBPICTURE;
p_free_subpic = NULL; p_free_subpic = NULL;
intf_ErrMsg("spu warning: %s", strerror( ENOMEM ) ); intf_ErrMsg( "vout error: spu allocation returned %s",
strerror( ENOMEM ) );
} }
#ifdef DEBUG_VOUT #ifdef DEBUG_VOUT
...@@ -698,7 +700,8 @@ picture_t *vout_CreatePicture( vout_thread_t *p_vout, int i_type, ...@@ -698,7 +700,8 @@ picture_t *vout_CreatePicture( vout_thread_t *p_vout, int i_type,
p_free_picture->i_type = EMPTY_PICTURE; p_free_picture->i_type = EMPTY_PICTURE;
p_free_picture->i_status = FREE_PICTURE; p_free_picture->i_status = FREE_PICTURE;
p_free_picture = NULL; p_free_picture = NULL;
intf_ErrMsg( "vout warning: %s", strerror( ENOMEM ) ); intf_ErrMsg( "vout error: picture allocation returned %s",
strerror( ENOMEM ) );
} }
#ifdef DEBUG_VOUT #ifdef DEBUG_VOUT
...@@ -929,7 +932,7 @@ static int InitThread( vout_thread_t *p_vout ) ...@@ -929,7 +932,7 @@ static int InitThread( vout_thread_t *p_vout )
/* Initialize convertion tables and functions */ /* Initialize convertion tables and functions */
if( vout_InitYUV( p_vout ) ) if( vout_InitYUV( p_vout ) )
{ {
intf_ErrMsg("error: can't allocate YUV translation tables"); intf_ErrMsg("vout error: can't allocate YUV translation tables");
return( 1 ); return( 1 );
} }
} }
...@@ -1142,7 +1145,6 @@ static void RunThread( vout_thread_t *p_vout) ...@@ -1142,7 +1145,6 @@ static void RunThread( vout_thread_t *p_vout)
} else { } else {
/* no splash screen ! */ /* no splash screen ! */
intf_ErrMsgImm("End of splash screen");
p_vout->init_display_date=0; p_vout->init_display_date=0;
} }
} }
...@@ -2042,7 +2044,7 @@ static int Manage( vout_thread_t *p_vout ) ...@@ -2042,7 +2044,7 @@ static int Manage( vout_thread_t *p_vout )
{ {
if( vout_ResetYUV( p_vout ) ) if( vout_ResetYUV( p_vout ) )
{ {
intf_ErrMsg("error: can't rebuild convertion tables"); intf_ErrMsg( "vout error: can't rebuild conversion tables" );
return( 1 ); return( 1 );
} }
} }
...@@ -2058,7 +2060,7 @@ static int Manage( vout_thread_t *p_vout ) ...@@ -2058,7 +2060,7 @@ static int Manage( vout_thread_t *p_vout )
{ {
/* Some changes were not acknowledged by p_vout->p_sys_manage or this /* Some changes were not acknowledged by p_vout->p_sys_manage or this
* function, it means they should not be authorized */ * function, it means they should not be authorized */
intf_ErrMsg( "error: unauthorized changes in the video output thread" ); intf_ErrMsg( "vout error: unauthorized changes in the vout thread" );
return( 1 ); return( 1 );
} }
...@@ -2127,6 +2129,6 @@ static int Align( vout_thread_t *p_vout, int *pi_x, int *pi_y, ...@@ -2127,6 +2129,6 @@ static int Align( vout_thread_t *p_vout, int *pi_x, int *pi_y,
static void SetPalette ( p_vout_thread_t p_vout, u16 *red, static void SetPalette ( p_vout_thread_t p_vout, u16 *red,
u16 *green, u16 *blue, u16 *transp ) u16 *green, u16 *blue, u16 *transp )
{ {
intf_ErrMsg( "SetPalette: method does not support palette changing" ); intf_ErrMsg( "vout error: method does not support palette changing" );
} }
...@@ -228,7 +228,8 @@ vout_font_t *vout_LoadFont( const char *psz_name ) ...@@ -228,7 +228,8 @@ vout_font_t *vout_LoadFont( const char *psz_name )
p_font = malloc( sizeof( vout_font_t ) ); p_font = malloc( sizeof( vout_font_t ) );
if( p_font == NULL ) if( p_font == NULL )
{ {
intf_ErrMsg("vout error: %s", strerror(ENOMEM)); intf_ErrMsg( "vout error: cannot allocate vout_font_t (%s)",
strerror(ENOMEM) );
close( i_file ); close( i_file );
return( NULL ); return( NULL );
} }
...@@ -245,7 +246,7 @@ vout_font_t *vout_LoadFont( const char *psz_name ) ...@@ -245,7 +246,7 @@ vout_font_t *vout_LoadFont( const char *psz_name )
/* Read font header - two bytes indicate the font properties */ /* Read font header - two bytes indicate the font properties */
if( read( i_file, pi_buffer, 2 ) != 2) if( read( i_file, pi_buffer, 2 ) != 2)
{ {
intf_ErrMsg("error: unexpected end of file '%s'", psz_name ); intf_ErrMsg( "vout error: unexpected end of file '%s'", psz_name );
free( p_font ); free( p_font );
close( i_file ); close( i_file );
return( NULL ); return( NULL );
...@@ -265,7 +266,8 @@ vout_font_t *vout_LoadFont( const char *psz_name ) ...@@ -265,7 +266,8 @@ vout_font_t *vout_LoadFont( const char *psz_name )
p_font->p_data = malloc( 2 * 256 * pi_buffer[1] ); p_font->p_data = malloc( 2 * 256 * pi_buffer[1] );
if( p_font->p_data == NULL ) if( p_font->p_data == NULL )
{ {
intf_ErrMsg("error: %s", strerror(ENOMEM)); intf_ErrMsg( "vout error: cannot allocate font space (%s)",
strerror(ENOMEM) );
free( p_font ); free( p_font );
close( i_file ); close( i_file );
return( NULL ); return( NULL );
...@@ -274,7 +276,7 @@ vout_font_t *vout_LoadFont( const char *psz_name ) ...@@ -274,7 +276,7 @@ vout_font_t *vout_LoadFont( const char *psz_name )
/* Copy raw data */ /* Copy raw data */
if( read( i_file, p_font->p_data, 256 * pi_buffer[1] ) != 256 * pi_buffer[1] ) if( read( i_file, p_font->p_data, 256 * pi_buffer[1] ) != 256 * pi_buffer[1] )
{ {
intf_ErrMsg("error: unexpected end of file '%s'", psz_name ); intf_ErrMsg("vout error: unexpected end of file '%s'", psz_name );
free( p_font->p_data ); free( p_font->p_data );
free( p_font ); free( p_font );
close( i_file ); close( i_file );
...@@ -300,7 +302,7 @@ vout_font_t *vout_LoadFont( const char *psz_name ) ...@@ -300,7 +302,7 @@ vout_font_t *vout_LoadFont( const char *psz_name )
break; break;
default: default:
intf_ErrMsg("error: file '%s' has an unknown format", psz_name ); intf_ErrMsg("vout error: file '%s' has an unknown format", psz_name );
free( p_font ); free( p_font );
close( i_file ); close( i_file );
return( NULL ); return( NULL );
......
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