Skip to content

Commit

Permalink
mux: fix warnings, fix Control() indentation
Browse files Browse the repository at this point in the history
    avi/avi_HeaderAdd_str{h,f}(): removes unused parameter
    mp4/Convert{SUBT,AVC1}() GetD263Tag() Get{Text,Vide}Box(): same
    mpeg/ts/BufferChainClean(): same
    ogg/OggCreate{Header,Footer}(): same
  • Loading branch information
funman committed Jan 29, 2008
1 parent 51bc0c4 commit 25ad0cd
Show file tree
Hide file tree
Showing 9 changed files with 135 additions and 135 deletions.
3 changes: 2 additions & 1 deletion modules/mux/asf.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ static void Close( vlc_object_t * p_this )
}

/* rewrite header */
if( !sout_AccessOutSeek( p_mux->p_access, 0 ) )
if( sout_AccessOutSeek( p_mux->p_access, 0 ) == VLC_SUCCESS )
{
out = asf_header_create( p_mux, VLC_FALSE );
sout_AccessOutWrite( p_mux->p_access, out );
Expand Down Expand Up @@ -581,6 +581,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
*****************************************************************************/
static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input )
{
VLC_UNUSED(p_input);
msg_Dbg( p_mux, "removing input" );
return VLC_SUCCESS;
}
Expand Down
22 changes: 8 additions & 14 deletions modules/mux/avi.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ static void Close( vlc_object_t * p_this )

static int Control( sout_mux_t *p_mux, int i_query, va_list args )
{
VLC_UNUSED(p_mux);
vlc_bool_t *pb_bool;
char **ppsz;

Expand Down Expand Up @@ -404,8 +405,7 @@ static int Mux ( sout_mux_t *p_mux )
{
sout_mux_sys_t *p_sys = p_mux->p_sys;
avi_stream_t *p_stream;
int i_stream;
int i;
int i_stream, i;

if( p_sys->b_write_header )
{
Expand Down Expand Up @@ -660,9 +660,7 @@ static int avi_HeaderAdd_avih( sout_mux_t *p_mux,

AVI_BOX_EXIT( 0 );
}
static int avi_HeaderAdd_strh( sout_mux_t *p_mux,
buffer_out_t *p_bo,
avi_stream_t *p_stream )
static int avi_HeaderAdd_strh( buffer_out_t *p_bo, avi_stream_t *p_stream )
{
AVI_BOX_ENTER( "strh" );

Expand Down Expand Up @@ -729,9 +727,7 @@ static int avi_HeaderAdd_strh( sout_mux_t *p_mux,
AVI_BOX_EXIT( 0 );
}

static int avi_HeaderAdd_strf( sout_mux_t *p_mux,
buffer_out_t *p_bo,
avi_stream_t *p_stream )
static int avi_HeaderAdd_strf( buffer_out_t *p_bo, avi_stream_t *p_stream )
{
AVI_BOX_ENTER( "strf" );

Expand Down Expand Up @@ -775,14 +771,12 @@ static int avi_HeaderAdd_strf( sout_mux_t *p_mux,
AVI_BOX_EXIT( 0 );
}

static int avi_HeaderAdd_strl( sout_mux_t *p_mux,
buffer_out_t *p_bo,
avi_stream_t *p_stream )
static int avi_HeaderAdd_strl( buffer_out_t *p_bo, avi_stream_t *p_stream )
{
AVI_BOX_ENTER_LIST( "strl" );

avi_HeaderAdd_strh( p_mux, p_bo, p_stream );
avi_HeaderAdd_strf( p_mux, p_bo, p_stream );
avi_HeaderAdd_strh( p_bo, p_stream );
avi_HeaderAdd_strf( p_bo, p_stream );

AVI_BOX_EXIT( 0 );
}
Expand Down Expand Up @@ -812,7 +806,7 @@ static block_t *avi_HeaderCreateRIFF( sout_mux_t *p_mux )
avi_HeaderAdd_avih( p_mux, &bo );
for( i_stream = 0,i_maxbytespersec = 0; i_stream < p_sys->i_streams; i_stream++ )
{
avi_HeaderAdd_strl( p_mux, &bo, &p_sys->stream[i_stream] );
avi_HeaderAdd_strl( &bo, &p_sys->stream[i_stream] );
}

i_junk = HDR_SIZE - bo.i_buffer - 8 - 12;
Expand Down
25 changes: 14 additions & 11 deletions modules/mux/dummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,34 +103,37 @@ static void Close( vlc_object_t * p_this )

static int Control( sout_mux_t *p_mux, int i_query, va_list args )
{
VLC_UNUSED(p_mux);
vlc_bool_t *pb_bool;

switch( i_query )
{
case MUX_CAN_ADD_STREAM_WHILE_MUXING:
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
*pb_bool = VLC_TRUE;
return VLC_SUCCESS;
switch( i_query )
{
case MUX_CAN_ADD_STREAM_WHILE_MUXING:
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
*pb_bool = VLC_TRUE;
return VLC_SUCCESS;

case MUX_GET_ADD_STREAM_WAIT:
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
*pb_bool = VLC_FALSE;
return VLC_SUCCESS;
case MUX_GET_ADD_STREAM_WAIT:
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
*pb_bool = VLC_FALSE;
return VLC_SUCCESS;

case MUX_GET_MIME: /* Unknown */
case MUX_GET_MIME: /* Unknown */
default:
return VLC_EGENERIC;
}
}

static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
{
VLC_UNUSED(p_input);
msg_Dbg( p_mux, "adding input" );
return VLC_SUCCESS;
}

static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input )
{
VLC_UNUSED(p_input);
msg_Dbg( p_mux, "removing input" );
return VLC_SUCCESS;
}
Expand Down
53 changes: 27 additions & 26 deletions modules/mux/mp4.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ static block_t *bo_to_sout( sout_instance_t *p_sout, bo_t *box );

static bo_t *GetMoovBox( sout_mux_t *p_mux );

static block_t *ConvertSUBT( sout_mux_t *, mp4_stream_t *, block_t *);
static block_t *ConvertAVC1( sout_mux_t *, mp4_stream_t *, block_t * );
static block_t *ConvertSUBT( block_t *);
static block_t *ConvertAVC1( block_t * );

/*****************************************************************************
* Open:
Expand Down Expand Up @@ -366,24 +366,25 @@ static void Close( vlc_object_t * p_this )
*****************************************************************************/
static int Control( sout_mux_t *p_mux, int i_query, va_list args )
{
VLC_UNUSED(p_mux);
vlc_bool_t *pb_bool;

switch( i_query )
{
case MUX_CAN_ADD_STREAM_WHILE_MUXING:
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
*pb_bool = VLC_FALSE;
return VLC_SUCCESS;
switch( i_query )
{
case MUX_CAN_ADD_STREAM_WHILE_MUXING:
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
*pb_bool = VLC_FALSE;
return VLC_SUCCESS;

case MUX_GET_ADD_STREAM_WAIT:
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
*pb_bool = VLC_TRUE;
return VLC_SUCCESS;
case MUX_GET_ADD_STREAM_WAIT:
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
*pb_bool = VLC_TRUE;
return VLC_SUCCESS;

case MUX_GET_MIME: /* Not needed, as not streamable */
case MUX_GET_MIME: /* Not needed, as not streamable */
default:
return VLC_EGENERIC;
}
}
}

/*****************************************************************************
Expand Down Expand Up @@ -444,15 +445,15 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
*****************************************************************************/
static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input )
{
VLC_UNUSED(p_input);
msg_Dbg( p_mux, "removing input" );
return VLC_SUCCESS;
}

static int MuxGetStream( sout_mux_t *p_mux, int *pi_stream, mtime_t *pi_dts )
{
mtime_t i_dts;
int i_stream;
int i;
int i_stream, i;

for( i = 0, i_dts = 0, i_stream = -1; i < p_mux->i_nb_inputs; i++ )
{
Expand Down Expand Up @@ -514,11 +515,11 @@ static int Mux( sout_mux_t *p_mux )
p_data = block_FifoGet( p_input->p_fifo );
if( p_stream->fmt.i_codec == VLC_FOURCC( 'h', '2', '6', '4' ) )
{
p_data = ConvertAVC1( p_mux, p_stream, p_data );
p_data = ConvertAVC1( p_data );
}
else if( p_stream->fmt.i_codec == VLC_FOURCC( 's', 'u', 'b', 't' ) )
{
p_data = ConvertSUBT( p_mux, p_stream, p_data );
p_data = ConvertSUBT( p_data );
}
if( p_data == NULL ) goto again;

Expand Down Expand Up @@ -653,7 +654,7 @@ static int Mux( sout_mux_t *p_mux )
/*****************************************************************************
*
*****************************************************************************/
static block_t *ConvertSUBT( sout_mux_t *p_mux, mp4_stream_t *tk, block_t *p_block )
static block_t *ConvertSUBT( block_t *p_block )
{
p_block = block_Realloc( p_block, 2, p_block->i_buffer );

Expand All @@ -667,7 +668,7 @@ static block_t *ConvertSUBT( sout_mux_t *p_mux, mp4_stream_t *tk, block_t *p_blo
return p_block;
}

static block_t *ConvertAVC1( sout_mux_t *p_mux, mp4_stream_t *tk, block_t *p_block )
static block_t *ConvertAVC1( block_t *p_block )
{
uint8_t *last = p_block->p_buffer; /* Assume it starts with 0x00000001 */
uint8_t *dat = &p_block->p_buffer[4];
Expand Down Expand Up @@ -882,7 +883,7 @@ static bo_t *GetDamrTag( mp4_stream_t *p_stream )
return damr;
}

static bo_t *GetD263Tag( mp4_stream_t *p_stream )
static bo_t *GetD263Tag( void )
{
bo_t *d263;

Expand Down Expand Up @@ -1184,7 +1185,7 @@ static bo_t *GetSounBox( sout_mux_t *p_mux, mp4_stream_t *p_stream )
return soun;
}

static bo_t *GetVideBox( sout_mux_t *p_mux, mp4_stream_t *p_stream )
static bo_t *GetVideBox( mp4_stream_t *p_stream )
{

bo_t *vide;
Expand Down Expand Up @@ -1278,7 +1279,7 @@ static bo_t *GetVideBox( sout_mux_t *p_mux, mp4_stream_t *p_stream )

case VLC_FOURCC('H','2','6','3'):
{
bo_t *d263 = GetD263Tag( p_stream );
bo_t *d263 = GetD263Tag();

box_fix( d263 );
box_gather( vide, d263 );
Expand Down Expand Up @@ -1307,7 +1308,7 @@ static bo_t *GetVideBox( sout_mux_t *p_mux, mp4_stream_t *p_stream )
return vide;
}

static bo_t *GetTextBox( sout_mux_t *p_mux, mp4_stream_t *p_stream )
static bo_t *GetTextBox( void )
{

bo_t *text = box_new( "text" );
Expand Down Expand Up @@ -1365,12 +1366,12 @@ static bo_t *GetStblBox( sout_mux_t *p_mux, mp4_stream_t *p_stream )
}
else if( p_stream->fmt.i_cat == VIDEO_ES )
{
bo_t *vide = GetVideBox( p_mux, p_stream );
bo_t *vide = GetVideBox( p_stream );
box_gather( stsd, vide );
}
else if( p_stream->fmt.i_cat == SPU_ES )
{
box_gather( stsd, GetTextBox( p_mux, p_stream ) );
box_gather( stsd, GetTextBox() );
}
box_fix( stsd );

Expand Down
36 changes: 18 additions & 18 deletions modules/mux/mpeg/ps.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,29 +231,30 @@ static void Close( vlc_object_t * p_this )
*****************************************************************************/
static int Control( sout_mux_t *p_mux, int i_query, va_list args )
{
VLC_UNUSED(p_mux);
vlc_bool_t *pb_bool;
char **ppsz;

switch( i_query )
{
case MUX_CAN_ADD_STREAM_WHILE_MUXING:
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
*pb_bool = VLC_TRUE;
return VLC_SUCCESS;
switch( i_query )
{
case MUX_CAN_ADD_STREAM_WHILE_MUXING:
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
*pb_bool = VLC_TRUE;
return VLC_SUCCESS;

case MUX_GET_ADD_STREAM_WAIT:
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
*pb_bool = VLC_FALSE;
return VLC_SUCCESS;
case MUX_GET_ADD_STREAM_WAIT:
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
*pb_bool = VLC_FALSE;
return VLC_SUCCESS;

case MUX_GET_MIME:
ppsz = (char**)va_arg( args, char ** );
*ppsz = strdup( "video/mpeg" );
return VLC_SUCCESS;
case MUX_GET_MIME:
ppsz = (char**)va_arg( args, char ** );
*ppsz = strdup( "video/mpeg" );
return VLC_SUCCESS;

default:
return VLC_EGENERIC;
}
}
}

/*****************************************************************************
Expand Down Expand Up @@ -794,7 +795,7 @@ static void MuxWritePSM( sout_mux_t *p_mux, block_t **p_buf, mtime_t i_dts )
/* CRC32 */
{
uint32_t i_crc = 0xffffffff;
for( i = 0; i < p_hdr->i_buffer; i++ )
for( i = 0; (size_t)i < p_hdr->i_buffer; i++ )
i_crc = (i_crc << 8) ^
p_sys->crc32_table[((i_crc >> 24) ^ p_hdr->p_buffer[i]) & 0xff];

Expand All @@ -810,8 +811,7 @@ static void MuxWritePSM( sout_mux_t *p_mux, block_t **p_buf, mtime_t i_dts )
static int MuxGetStream( sout_mux_t *p_mux, int *pi_stream, mtime_t *pi_dts )
{
mtime_t i_dts;
int i_stream;
int i;
int i_stream, i;

for( i = 0, i_dts = 0, i_stream = -1; i < p_mux->i_nb_inputs; i++ )
{
Expand Down
Loading

0 comments on commit 25ad0cd

Please sign in to comment.