Commit 25ad0cde authored by Rafaël Carré's avatar Rafaël Carré

mux: fix warnings, fix Control() indentation

    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
parent 51bc0c4a
......@@ -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 );
......@@ -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;
}
......
......@@ -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;
......@@ -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 )
{
......@@ -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" );
......@@ -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" );
......@@ -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 );
}
......@@ -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;
......
......@@ -103,6 +103,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;
switch( i_query )
......@@ -125,12 +126,14 @@ static int Control( sout_mux_t *p_mux, int i_query, va_list args )
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;
}
......
......@@ -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:
......@@ -366,6 +366,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;
switch( i_query )
......@@ -444,6 +445,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;
}
......@@ -451,8 +453,7 @@ static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input )
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++ )
{
......@@ -514,11 +515,11 @@ again:
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;
......@@ -653,7 +654,7 @@ again:
/*****************************************************************************
*
*****************************************************************************/
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 );
......@@ -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];
......@@ -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;
......@@ -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;
......@@ -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 );
......@@ -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" );
......@@ -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 );
......
......@@ -231,6 +231,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;
......@@ -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];
......@@ -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++ )
{
......
......@@ -307,8 +307,7 @@ static inline block_t *BufferChainPeek( sout_buffer_chain_t *c )
return b;
}
static inline void BufferChainClean( sout_instance_t *p_sout,
sout_buffer_chain_t *c )
static inline void BufferChainClean( sout_buffer_chain_t *c )
{
block_t *b;
......@@ -857,6 +856,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;
......@@ -1221,7 +1221,7 @@ static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input )
}
/* Empty all data in chain_pes */
BufferChainClean( p_mux->p_sout, &p_stream->chain_pes );
BufferChainClean( &p_stream->chain_pes );
if( p_stream->lang )
{
......@@ -1374,8 +1374,7 @@ static int Mux( sout_mux_t *p_mux )
if ( ( i_spu_delay >= I64C(100000000) ) ||
( i_spu_delay < I64C(10000) ) )
{
BufferChainClean( p_mux->p_sout,
&p_stream->chain_pes );
BufferChainClean( &p_stream->chain_pes );
p_stream->i_pes_dts = 0;
p_stream->i_pes_used = 0;
p_stream->i_pes_length = 0;
......@@ -1417,16 +1416,14 @@ static int Mux( sout_mux_t *p_mux )
p_pcr_stream->i_pes_dts );
block_Release( p_data );
BufferChainClean( p_mux->p_sout,
&p_stream->chain_pes );
BufferChainClean( &p_stream->chain_pes );
p_stream->i_pes_dts = 0;
p_stream->i_pes_used = 0;
p_stream->i_pes_length = 0;
if( p_input->p_fmt->i_cat != SPU_ES )
{
BufferChainClean( p_mux->p_sout,
&p_pcr_stream->chain_pes );
BufferChainClean( &p_pcr_stream->chain_pes );
p_pcr_stream->i_pes_dts = 0;
p_pcr_stream->i_pes_used = 0;
p_pcr_stream->i_pes_length = 0;
......
......@@ -95,6 +95,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;
......@@ -145,6 +146,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;
}
......
......@@ -67,8 +67,8 @@ static int DelStream( sout_mux_t *, sout_input_t * );
static int Mux ( sout_mux_t * );
static int MuxBlock ( sout_mux_t *, sout_input_t * );
static block_t *OggCreateHeader( sout_mux_t *, mtime_t );
static block_t *OggCreateFooter( sout_mux_t *, mtime_t );
static block_t *OggCreateHeader( sout_mux_t * );
static block_t *OggCreateFooter( sout_mux_t * );
/*****************************************************************************
* Misc declarations
......@@ -136,8 +136,7 @@ typedef struct
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++ )
{
......@@ -256,7 +255,7 @@ static void Close( vlc_object_t * p_this )
/* Close the current ogg stream */
msg_Dbg( p_mux, "writing footer" );
block_ChainAppend( &p_og, OggCreateFooter( p_mux, 0 ) );
block_ChainAppend( &p_og, OggCreateFooter( p_mux ) );
/* Remove deleted logical streams */
for( i = 0; i < p_sys->i_del_streams; i++ )
......@@ -282,6 +281,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;
......@@ -583,7 +583,7 @@ static block_t *OggStreamPageOut( sout_mux_t *p_mux,
return p_og_first;
}
static block_t *OggCreateHeader( sout_mux_t *p_mux, mtime_t i_dts )
static block_t *OggCreateHeader( sout_mux_t *p_mux )
{
block_t *p_hdr = NULL;
block_t *p_og = NULL;
......@@ -778,7 +778,7 @@ static block_t *OggCreateHeader( sout_mux_t *p_mux, mtime_t i_dts )
return p_hdr;
}
static block_t *OggCreateFooter( sout_mux_t *p_mux, mtime_t i_dts )
static block_t *OggCreateFooter( sout_mux_t *p_mux )
{
sout_mux_sys_t *p_sys = p_mux->p_sys;
block_t *p_hdr = NULL;
......@@ -886,7 +886,7 @@ static int Mux( sout_mux_t *p_mux )
int i;
msg_Dbg( p_mux, "writing footer" );
block_ChainAppend( &p_og, OggCreateFooter( p_mux, 0 ) );
block_ChainAppend( &p_og, OggCreateFooter( p_mux ) );
/* Remove deleted logical streams */
for( i = 0; i < p_sys->i_del_streams; i++ )
......@@ -903,7 +903,7 @@ static int Mux( sout_mux_t *p_mux )
p_sys->i_streams = p_mux->i_nb_inputs;
p_sys->i_del_streams = 0;
p_sys->i_add_streams = 0;
block_ChainAppend( &p_og, OggCreateHeader( p_mux, i_dts ) );
block_ChainAppend( &p_og, OggCreateHeader( p_mux ) );
/* Write header and/or footer */
OggSetDate( p_og, i_dts, 0 );
......
......@@ -130,6 +130,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;
......@@ -263,10 +264,11 @@ static block_t *GetHeader( sout_mux_t *p_mux )
static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input )
{
VLC_UNUSED(p_input);
msg_Dbg( p_mux, "removing input" );
msg_Dbg( p_mux, "writing header data" );
if( !sout_AccessOutSeek( p_mux->p_access, 0 ) )
if( sout_AccessOutSeek( p_mux->p_access, 0 ) == VLC_SUCCESS )
{
sout_AccessOutWrite( p_mux->p_access, GetHeader( p_mux ) );
}
......
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