Commit a132d75c authored by Sam Hocevar's avatar Sam Hocevar

 . 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)"
parent df5793c2
......@@ -137,7 +137,7 @@
#define INTF_CHANNELS_DEFAULT "vlc.channels"
/* Base delay in micro second for interface sleeps */
#define INTF_IDLE_SLEEP ((int)(0.100*CLOCK_FREQ))
#define INTF_IDLE_SLEEP ((int)(0.050*CLOCK_FREQ))
/* Step for changing gamma, and minimum and maximum values */
#define INTF_GAMMA_STEP .1
......
......@@ -212,7 +212,7 @@ static __inline__ int vlc_mutex_init( vlc_mutex_t *p_mutex )
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
// check the arguments and whether it's already been initialized
/* check the arguments and whether it's already been initialized */
if( p_mutex == NULL ) return B_BAD_VALUE;
if( p_mutex->init == 9999 )
{
......
......@@ -23,7 +23,8 @@
static __inline__ u8 GetByte (ac3_byte_stream_t * p_byte_stream)
{
/* Are there some bytes left in the current buffer ? */
if (p_byte_stream->p_byte >= p_byte_stream->p_end) {
if (p_byte_stream->p_byte >= p_byte_stream->p_end)
{
/* no, switch to next buffer */
ac3_byte_stream_next (p_byte_stream);
}
......@@ -33,7 +34,8 @@ static __inline__ u8 GetByte (ac3_byte_stream_t * p_byte_stream)
static __inline__ void NeedBits (ac3_bit_stream_t * p_bit_stream, int i_bits)
{
while (p_bit_stream->i_available < i_bits) {
while (p_bit_stream->i_available < i_bits)
{
p_bit_stream->buffer |=
((u32)GetByte (&p_bit_stream->byte_stream)) << (24 - p_bit_stream->i_available);
p_bit_stream->i_available += 8;
......
......@@ -335,16 +335,19 @@ typedef struct audblk_s {
* approximate a 1/6 octave scale.
*/
typedef struct stream_coeffs_s {
typedef struct stream_coeffs_s
{
float fbw[5][256];
float lfe[256];
} stream_coeffs_t;
typedef struct stream_samples_s {
typedef struct stream_samples_s
{
float channel[6][256];
} stream_samples_t;
typedef struct ac3_bit_stream_s {
typedef struct ac3_bit_stream_s
{
u32 buffer;
int i_available;
ac3_byte_stream_t byte_stream;
......@@ -352,7 +355,8 @@ typedef struct ac3_bit_stream_s {
unsigned int total_bits_read; /* temporary */
} ac3_bit_stream_t;
struct ac3dec_s {
struct ac3dec_s
{
/*
* Input properties
*/
......
......@@ -2,7 +2,7 @@
* ac3_decoder_thread.h : ac3 decoder thread interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: ac3_decoder_thread.h,v 1.2 2000/12/21 13:25:50 massiot Exp $
* $Id: ac3_decoder_thread.h,v 1.3 2001/01/05 14:45:47 sam Exp $
*
* Authors:
* Michel Kaempf <maxx@via.ecp.fr>
......
......@@ -27,7 +27,8 @@
#define NORM 16384
typedef struct prefs_s {
typedef struct prefs_s
{
u16 use_dolby_surround;
u16 dual_mono_channel_select;
} prefs_t;
......@@ -56,8 +57,10 @@ void downmix (ac3dec_t * p_ac3dec, s16 * out_buf)
*/
/* There are two main cases, with or without Dolby Surround */
if (global_prefs.use_dolby_surround) {
switch(p_ac3dec->bsi.acmod) {
if (global_prefs.use_dolby_surround)
{
switch(p_ac3dec->bsi.acmod)
{
case 7: /* 3/2 */
left = p_ac3dec->samples.channel[0];
centre = p_ac3dec->samples.channel[1];
......@@ -65,7 +68,8 @@ void downmix (ac3dec_t * p_ac3dec, s16 * out_buf)
left_sur = p_ac3dec->samples.channel[3];
right_sur = p_ac3dec->samples.channel[4];
for (j = 0; j < 256; j++) {
for (j = 0; j < 256; j++)
{
right_tmp = 0.2265f * *left_sur++ + 0.2265f * *right_sur++;
left_tmp = -1 * right_tmp;
right_tmp += 0.3204f * *right++ + 0.2265f * *centre;
......@@ -82,7 +86,8 @@ void downmix (ac3dec_t * p_ac3dec, s16 * out_buf)
left_sur = p_ac3dec->samples.channel[2];
right_sur = p_ac3dec->samples.channel[3];
for (j = 0; j < 256; j++) {
for (j = 0; j < 256; j++)
{
right_tmp = 0.2265f * *left_sur++ + 0.2265f * *right_sur++;
left_tmp = -1 * right_tmp;
right_tmp += 0.3204f * *right++;
......@@ -100,7 +105,8 @@ void downmix (ac3dec_t * p_ac3dec, s16 * out_buf)
/* Mono surround */
right_sur = p_ac3dec->samples.channel[3];
for (j = 0; j < 256; j++) {
for (j = 0; j < 256; j++)
{
right_tmp = 0.2265f * *right_sur++;
left_tmp = - right_tmp;
right_tmp += 0.3204f * *right++ + 0.2265f * *centre;
......@@ -117,7 +123,8 @@ void downmix (ac3dec_t * p_ac3dec, s16 * out_buf)
/* Mono surround */
right_sur = p_ac3dec->samples.channel[2];
for (j = 0; j < 256; j++) {
for (j = 0; j < 256; j++)
{
right_tmp = 0.2265f * *right_sur++;
left_tmp = - right_tmp;
right_tmp += 0.3204f * *right++;
......@@ -133,7 +140,8 @@ void downmix (ac3dec_t * p_ac3dec, s16 * out_buf)
centre = p_ac3dec->samples.channel[1];
right = p_ac3dec->samples.channel[2];
for (j = 0; j < 256; j++) {
for (j = 0; j < 256; j++)
{
right_tmp = 0.3204f * *right++ + 0.2265f * *centre;
left_tmp = 0.3204f * *left++ + 0.2265f * *centre++;
......@@ -146,7 +154,8 @@ void downmix (ac3dec_t * p_ac3dec, s16 * out_buf)
left = p_ac3dec->samples.channel[0];
right = p_ac3dec->samples.channel[1];
for (j = 0; j < 256; j++) {
for (j = 0; j < 256; j++)
{
*(out_buf++) = *(left++) * NORM;
*(out_buf++) = *(right++) * NORM;
}
......@@ -156,7 +165,8 @@ void downmix (ac3dec_t * p_ac3dec, s16 * out_buf)
/* Mono program! */
right = p_ac3dec->samples.channel[0];
for (j = 0; j < 256; j++) {
for (j = 0; j < 256; j++)
{
right_tmp = 0.7071f * *right++;
*(out_buf++) = right_tmp * NORM;
......@@ -168,7 +178,8 @@ void downmix (ac3dec_t * p_ac3dec, s16 * out_buf)
/* Dual mono, output selected by user */
right = p_ac3dec->samples.channel[global_prefs.dual_mono_channel_select];
for (j = 0; j < 256; j++) {
for (j = 0; j < 256; j++)
{
right_tmp = 0.7071f * *right++;
*(out_buf++) = right_tmp * NORM;
......@@ -178,7 +189,8 @@ void downmix (ac3dec_t * p_ac3dec, s16 * out_buf)
}
} else {
/* Non-Dolby surround downmixes */
switch(p_ac3dec->bsi.acmod) {
switch(p_ac3dec->bsi.acmod)
{
case 7: /* 3/2 */
left = p_ac3dec->samples.channel[0];
centre = p_ac3dec->samples.channel[1];
......@@ -189,7 +201,8 @@ void downmix (ac3dec_t * p_ac3dec, s16 * out_buf)
clev = cmixlev_lut[p_ac3dec->bsi.cmixlev];
slev = smixlev_lut[p_ac3dec->bsi.surmixlev];
for (j = 0; j < 256; j++) {
for (j = 0; j < 256; j++)
{
right_tmp= 0.4142f * *right++ + clev * *centre + slev * *right_sur++;
left_tmp = 0.4142f * *left++ + clev * *centre++ + slev * *left_sur++;
......@@ -206,7 +219,8 @@ void downmix (ac3dec_t * p_ac3dec, s16 * out_buf)
slev = smixlev_lut[p_ac3dec->bsi.surmixlev];
for (j = 0; j < 256; j++) {
for (j = 0; j < 256; j++)
{
right_tmp= 0.4142f * *right++ + slev * *right_sur++;
left_tmp = 0.4142f * *left++ + slev * *left_sur++;
......@@ -225,7 +239,8 @@ void downmix (ac3dec_t * p_ac3dec, s16 * out_buf)
clev = cmixlev_lut[p_ac3dec->bsi.cmixlev];
slev = smixlev_lut[p_ac3dec->bsi.surmixlev];
for (j = 0; j < 256; j++) {
for (j = 0; j < 256; j++)
{
right_tmp= 0.4142f * *right++ + clev * *centre + slev * *right_sur;
left_tmp = 0.4142f * *left++ + clev * *centre++ + slev * *right_sur++;
......@@ -242,7 +257,8 @@ void downmix (ac3dec_t * p_ac3dec, s16 * out_buf)
slev = smixlev_lut[p_ac3dec->bsi.surmixlev];
for (j = 0; j < 256; j++) {
for (j = 0; j < 256; j++)
{
right_tmp= 0.4142f * *right++ + slev * *right_sur;
left_tmp = 0.4142f * *left++ + slev * *right_sur++;
......@@ -258,7 +274,8 @@ void downmix (ac3dec_t * p_ac3dec, s16 * out_buf)
clev = cmixlev_lut[p_ac3dec->bsi.cmixlev];
for (j = 0; j < 256; j++) {
for (j = 0; j < 256; j++)
{
right_tmp= 0.4142f * *right++ + clev * *centre;
left_tmp = 0.4142f * *left++ + clev * *centre++;
......@@ -271,7 +288,8 @@ void downmix (ac3dec_t * p_ac3dec, s16 * out_buf)
left = p_ac3dec->samples.channel[0];
right = p_ac3dec->samples.channel[1];
for (j = 0; j < 256; j++) {
for (j = 0; j < 256; j++)
{
*(out_buf++) = *(left++) * NORM;
*(out_buf++) = *(right++) * NORM;
}
......@@ -281,7 +299,8 @@ void downmix (ac3dec_t * p_ac3dec, s16 * out_buf)
/* Mono program! */
right = p_ac3dec->samples.channel[0];
for (j = 0; j < 256; j++) {
for (j = 0; j < 256; j++)
{
right_tmp = 0.7071f * *right++;
*(out_buf++) = right_tmp * NORM;
......@@ -293,7 +312,8 @@ void downmix (ac3dec_t * p_ac3dec, s16 * out_buf)
/* Dual mono, output selected by user */
right = p_ac3dec->samples.channel[global_prefs.dual_mono_channel_select];
for (j = 0; j < 256; j++) {
for (j = 0; j < 256; j++)
{
right_tmp = 0.7071f * *right++;
*(out_buf++) = right_tmp * NORM;
......@@ -303,3 +323,4 @@ void downmix (ac3dec_t * p_ac3dec, s16 * out_buf)
}
}
}
......@@ -36,28 +36,34 @@
#include "ac3_internal.h"
static const s16 exps_1[128] =
{ -2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
{
-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
0, 0, 0 };
0, 0, 0
};
static const s16 exps_2[128] =
{ -2,-2,-2,-2,-2,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
{
-2,-2,-2,-2,-2,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
-2,-2,-2,-2,-2,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
-2,-2,-2,-2,-2,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
-2,-2,-2,-2,-2,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
-2,-2,-2,-2,-2,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
0, 0, 0 };
0, 0, 0
};
static const s16 exps_3[128] =
{ -2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,
{
-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,
-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,
-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,
-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,
-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,
0, 0, 0 };
0, 0, 0
};
#define UNPACK_FBW 1
#define UNPACK_CPL 2
......@@ -70,7 +76,8 @@ static __inline__ int exp_unpack_ch (ac3dec_t * p_ac3dec, u16 type,
u16 i,j;
s16 exp_acc;
if (expstr == EXP_REUSE) {
if (expstr == EXP_REUSE)
{
return 0;
}
......@@ -80,15 +87,19 @@ static __inline__ int exp_unpack_ch (ac3dec_t * p_ac3dec, u16 type,
/* In the case of a fbw channel then the initial absolute values is
* also an exponent */
if (type != UNPACK_CPL) {
if (type != UNPACK_CPL)
{
dest[j++] = exp_acc;
}
/* Loop through the groups and fill the dest array appropriately */
switch (expstr) {
switch (expstr)
{
case EXP_D15: /* 1 */
for (i = 0; i < ngrps; i++) {
if (exps[i] > 124) {
for (i = 0; i < ngrps; i++)
{
if (exps[i] > 124)
{
intf_ErrMsg ( "ac3dec error: invalid exponent" );
return 1;
}
......@@ -102,8 +113,10 @@ static __inline__ int exp_unpack_ch (ac3dec_t * p_ac3dec, u16 type,
break;
case EXP_D25: /* 2 */
for (i = 0; i < ngrps; i++) {
if (exps[i] > 124) {
for (i = 0; i < ngrps; i++)
{
if (exps[i] > 124)
{
intf_ErrMsg ( "ac3dec error: invalid exponent" );
return 1;
}
......@@ -120,8 +133,10 @@ static __inline__ int exp_unpack_ch (ac3dec_t * p_ac3dec, u16 type,
break;
case EXP_D45: /* 3 */
for (i = 0; i < ngrps; i++) {
if (exps[i] > 124) {
for (i = 0; i < ngrps; i++)
{
if (exps[i] > 124)
{
intf_ErrMsg ( "ac3dec error: invalid exponent" );
return 1;
}
......@@ -151,31 +166,41 @@ int exponent_unpack (ac3dec_t * p_ac3dec)
{
u16 i;
for (i = 0; i < p_ac3dec->bsi.nfchans; i++) {
for (i = 0; i < p_ac3dec->bsi.nfchans; i++)
{
if (exp_unpack_ch (p_ac3dec, UNPACK_FBW, p_ac3dec->audblk.chexpstr[i],
p_ac3dec->audblk.nchgrps[i],
p_ac3dec->audblk.exps[i][0],
&p_ac3dec->audblk.exps[i][1],
p_ac3dec->audblk.fbw_exp[i]))
{
return 1;
}
}
if (p_ac3dec->audblk.cplinu) {
if (p_ac3dec->audblk.cplinu)
{
if (exp_unpack_ch (p_ac3dec, UNPACK_CPL, p_ac3dec->audblk.cplexpstr,
p_ac3dec->audblk.ncplgrps,
p_ac3dec->audblk.cplabsexp << 1,
p_ac3dec->audblk.cplexps,
&p_ac3dec->audblk.cpl_exp[p_ac3dec->audblk.cplstrtmant]))
{
return 1;
}
}
if (p_ac3dec->bsi.lfeon) {
if (p_ac3dec->bsi.lfeon)
{
if (exp_unpack_ch (p_ac3dec, UNPACK_LFE, p_ac3dec->audblk.lfeexpstr,
2, p_ac3dec->audblk.lfeexps[0],
&p_ac3dec->audblk.lfeexps[1],
p_ac3dec->audblk.lfe_exp))
{
return 1;
}
}
return 0;
}
This diff is collapsed.
This diff is collapsed.
......@@ -51,7 +51,9 @@ int main (void)
memset (&decoder, 0, sizeof (decoder));
if (adec_init (&decoder))
{
return 1;
}
stream = adec_byte_stream (&decoder);
stream->p_byte = NULL;
......@@ -60,17 +62,24 @@ int main (void)
framenum = 0;
while (1) {
while (1)
{
int i;
if (adec_sync_frame (&decoder, &sync_info))
{
return 1;
}
if (adec_decode_frame (&decoder, buffer))
{
return 1;
}
#if 1
for (i = 0; i < (2*1152); i++)
{
fprintf ( stderr, "%04X\n",(u16)buffer[i] );
}
#endif
}
......@@ -86,10 +95,13 @@ void adec_byte_stream_next (adec_byte_stream_t * p_byte_stream)
fd = p_byte_stream->info;
size = fread (buffer, 1, 1024, fd);
if (size) {
if (size)
{
p_byte_stream->p_byte = buffer;
p_byte_stream->p_end = buffer + size;
} else { /* end of stream, read dummy zeroes */
}
else
{ /* end of stream, read dummy zeroes */
p_byte_stream->p_byte = &dummy;
p_byte_stream->p_end = &dummy + 1;
}
......
......@@ -2,7 +2,7 @@
* audio_decoder.h : audio decoder thread interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: audio_decoder.h,v 1.3 2000/12/21 13:25:50 massiot Exp $
* $Id: audio_decoder.h,v 1.4 2001/01/05 14:45:47 sam Exp $
*
* Authors:
* Michel Kaempf <maxx@via.ecp.fr>
......
......@@ -4,7 +4,7 @@
* decoders.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input.c,v 1.64 2000/12/22 13:04:44 sam Exp $
* $Id: input.c,v 1.65 2001/01/05 14:45:47 sam Exp $
*
* Authors:
*
......@@ -80,7 +80,8 @@ input_thread_t *input_CreateThread ( input_config_t * p_config, int *pi_status )
p_input = (input_thread_t *)malloc( sizeof(input_thread_t) );
if( p_input == NULL )
{
intf_ErrMsg("error: %s", strerror(errno));
intf_ErrMsg( "input error: can't allocate input thread (%s)",
strerror(errno) );
free( p_config );
return( NULL );
}
......@@ -112,7 +113,8 @@ input_thread_t *input_CreateThread ( input_config_t * p_config, int *pi_status )
if( vlc_thread_create( &p_input->thread_id, "input", (void *) RunThread,
(void *) p_input ) )
{
intf_ErrMsg("error: %s", strerror(errno) );
intf_ErrMsg( "input error: can't create input thread (%s)",
strerror(errno) );
free( p_input );
free( p_config );
return( NULL );
......@@ -245,7 +247,7 @@ static void InitThread( input_thread_t * p_input )
case INPUT_METHOD_VLAN_BCAST: /* vlan network method */
/* if( !p_main->b_vlans )
{
intf_ErrMsg("error: vlans are not activated");
intf_ErrMsg("input error: vlans are not activated");
free( p_input );
return( NULL );
} */ /* la-lala */
......@@ -257,7 +259,8 @@ static void InitThread( input_thread_t * p_input )
break;
#ifdef DEBUG
default:
intf_ErrMsg("Unknow input method");
intf_ErrMsg( "input error: unknow method 0x%.4x",
p_input->p_config->i_method );
free( p_input->p_config );
p_input->b_error = 1;
break;
......@@ -344,24 +347,10 @@ static void FileOpen( input_thread_t * p_input )
#define p_config p_input->p_config
if( !strncmp( p_config->p_source, "-", 1 ) )
{
/* stdin */
p_input->i_handle = 0;
vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.b_pace_control = 1;
p_input->stream.b_seekable = 0;
p_input->stream.i_size = 0;
p_input->stream.i_tell = 0;
vlc_mutex_unlock( &p_input->stream.stream_lock );
}
else
{
if( stat( p_config->p_source, &stat_info ) == (-1) )
{
intf_ErrMsg("Cannot stat() file %s (%s)", p_config->p_source,
strerror(errno));
intf_ErrMsg( "input error: cannot stat() file %s (%s)",
p_config->p_source, strerror(errno));
p_input->b_error = 1;
return;
}
......@@ -385,7 +374,8 @@ static void FileOpen( input_thread_t * p_input )
else
{
vlc_mutex_unlock( &p_input->stream.stream_lock );
intf_ErrMsg("Unknown file type");
intf_ErrMsg( "input error: unknown file type for %s",
p_config->p_source );
p_input->b_error = 1;
return;
}
......@@ -397,11 +387,10 @@ static void FileOpen( input_thread_t * p_input )
if( (p_input->i_handle = open( p_config->p_source,
/*O_NONBLOCK | O_LARGEFILE*/0 )) == (-1) )
{
intf_ErrMsg("Cannot open file (%s)", strerror(errno));
intf_ErrMsg( "input error: cannot open file %s", strerror(errno) );
p_input->b_error = 1;
return;
}
}
#undef p_config
}
......@@ -100,7 +100,8 @@ intf_thread_t* intf_Create( void )
p_intf = malloc( sizeof( intf_thread_t ) );
if( !p_intf )
{
intf_ErrMsg("error: %s", strerror( ENOMEM ) );
intf_ErrMsg( "intf error: cannot create interface thread (%s)",
strerror( ENOMEM ) );
return( NULL );
}
......@@ -127,7 +128,7 @@ intf_thread_t* intf_Create( void )
if( i_best_score == 0 )
{
free( p_intf );
intf_ErrMsg( "error: no suitable plugin to create interface" );
intf_ErrMsg( "intf error: no suitable plugin" );
return( NULL );
}
......@@ -153,13 +154,13 @@ intf_thread_t* intf_Create( void )
p_intf->p_console = intf_ConsoleCreate();
if( p_intf->p_console == NULL )
{
intf_ErrMsg("error: can't create control console");
intf_ErrMsg( "intf error: cannot create control console" );
free( p_intf );
return( NULL );
}
if( p_intf->p_sys_create( p_intf ) )
{
intf_ErrMsg("error: can't create interface");
intf_ErrMsg("intf error: cannot create interface");
intf_ConsoleDestroy( p_intf->p_console );
free( p_intf );
return( NULL );
......@@ -188,7 +189,7 @@ void intf_Run( intf_thread_t *p_intf )
if( (p_input_config =
(input_config_t *)malloc( sizeof(input_config_t) )) == NULL )
{
intf_ErrMsg("Out of memory");
intf_ErrMsg( "intf error: cannot create input_config_t" );
}
else
{
......@@ -206,7 +207,7 @@ void intf_Run( intf_thread_t *p_intf )
if( (p_input_config =
(input_config_t *)malloc( sizeof(input_config_t) )) == NULL )
{
intf_ErrMsg("Out of memory");
intf_ErrMsg( "intf error: cannot create input_config_t" );
}
else
{
......@@ -222,7 +223,7 @@ void intf_Run( intf_thread_t *p_intf )
* the script could be executed but failed */
else if( intf_ExecScript( main_GetPszVariable( INTF_INIT_SCRIPT_VAR, INTF_INIT_SCRIPT_DEFAULT ) ) > 0 )
{
intf_ErrMsg("warning: error(s) during startup script");
intf_ErrMsg( "intf error: errors occured during startup script" );
}
/* Main loop */
......@@ -562,7 +563,8 @@ static int LoadChannels( intf_thread_t *p_intf, char *psz_filename )
p_file = fopen( psz_filename, "r" );
if( p_file == NULL )
{
intf_ErrMsg("error: can't open %s (%s)", psz_filename, strerror(errno));
intf_ErrMsg( "intf error: cannot open %s (%s)",
psz_filename, strerror(errno) );
return( 1 );
}
......@@ -580,7 +582,8 @@ static int LoadChannels( intf_thread_t *p_intf, char *psz_filename )
p_intf->p_channel = malloc( sizeof( intf_channel_t ) * i_index );
if( p_intf->p_channel == NULL )
{
intf_ErrMsg("error: %s", strerror(ENOMEM));
intf_ErrMsg( "intf error: cannot create intf_channel_t (%s)",
strerror(ENOMEM) );
fclose( p_file );
return( 1 );
}
......@@ -689,7 +692,8 @@ static int ParseChannel( intf_channel_t *p_channel, char *psz_str )
p_channel->psz_description = malloc( i_field_length + 1 );
if( p_channel->psz_description == NULL )
{
intf_ErrMsg("error: %s", strerror( ENOMEM ));
intf_ErrMsg( "intf error: cannot create channel "
"description (%s)", strerror( ENOMEM ) );
i_field = -1;
}
else
......@@ -712,7 +716,8 @@ static int ParseChannel( intf_channel_t *p_channel, char *psz_str )
p_channel->psz_input_source = malloc( i_field_length + 1 );
if( p_channel->psz_input_source == NULL )
{
intf_ErrMsg("error: %s", strerror( ENOMEM ));
intf_ErrMsg( "intf error: cannot create input "
"source (%s)", strerror( ENOMEM ) );
i_field = -1;
}
else
......
......@@ -121,7 +121,7 @@ int intf_ExecCommand( char *psz_cmd )
{
case INTF_FATAL_ERROR: /* fatal error */
/* Print message and terminates the interface thread */
intf_ErrMsg( "fatal error in command `%s'", psz_argv[0] );
intf_ErrMsg( "intf error: fatal error in command `%s'", psz_argv[0] );
p_main->p_intf->b_die = 1;
break;
......@@ -129,9 +129,8 @@ int intf_ExecCommand( char *psz_cmd )
/* Print message, flush messages queue and exit. Note that this
* error should be very rare since it does not even try to cancel
* other threads... */
intf_ErrMsg( "critical error in command `%s', "
intf_ErrMsgImm( "intf error: critical error in command `%s', "
"please report this error !", psz_argv[0] );
intf_FlushMsg();
exit( INTF_CRITICAL_ERROR );
break;
......@@ -203,7 +202,7 @@ int intf_ExecScript( char *psz_filename )
}
if( !feof( p_file ) )
{
intf_ErrMsg("error: %s: %s", psz_vlcrc, strerror(errno));
intf_ErrMsg( "intf error: %s: %s", psz_vlcrc, strerror(errno));
return( -1 );
}
......@@ -500,7 +499,8 @@ static int ConvertArgument( intf_arg_t *p_arg, int i_flags, char *psz_str )
#ifdef DEBUG
else /* error: missing type specifier */
{
intf_ErrMsg("error: missing type specifier for `%s' (0x%x)", psz_str, i_flags);
intf_ErrMsg( "intf error: missing type specifier for `%s' (0x%x)",
psz_str, i_flags );
return( 1 );
}
#endif
......
......@@ -392,14 +392,15 @@ void main_PutPszVariable( char *psz_name, char *psz_value )
psz_env = malloc( strlen(psz_name) + strlen(psz_value) + 2 );
if( psz_env == NULL )
{
intf_ErrMsg( "error: %s", strerror(ENOMEM) );
intf_ErrMsg( "intf error: cannot create psz_env (%s)",
strerror(ENOMEM) );
}
else
{
sprintf( psz_env, "%s=%s", psz_name, psz_value );
if( putenv( psz_env ) )
{
intf_ErrMsg( "error: %s", strerror(errno) );
intf_ErrMsg( "intf error: cannot putenv (%s)", strerror(errno) );
}
}
}
......@@ -437,9 +438,6 @@ static void SetDefaultConfiguration( void )
p_main->b_audio = 1;
p_main->b_video = 1;
p_main->b_vlans = 0;
/* This is |_|lt1m4t3 |<l|_|d63 */
main_PutIntVariable( INPUT_DVD_SUBTITLE_VAR, -1 );
}
/*****************************************************************************
......@@ -757,7 +755,7 @@ static void FatalSignalHandler( int i_signal )
signal( SIGQUIT, SIG_IGN );
/* Acknowledge the signal received */
intf_ErrMsgImm("intf: signal %d received, exiting", i_signal );
intf_ErrMsgImm("intf error: signal %d received, exiting", i_signal );
/* Try to terminate everything - this is done by requesting the end of the
* interface thread */
......
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