}
/* 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 );
*****************************************************************************/
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 Control( sout_mux_t *p_mux, int i_query, va_list args )
{
+ VLC_UNUSED(p_mux);
vlc_bool_t *pb_bool;
char **ppsz;
{
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 )
{
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" );
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" );
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 );
}
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;
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;
}
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:
*****************************************************************************/
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;
- }
+ }
}
/*****************************************************************************
*****************************************************************************/
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++ )
{
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;
/*****************************************************************************
*
*****************************************************************************/
-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 );
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];
return damr;
}
-static bo_t *GetD263Tag( mp4_stream_t *p_stream )
+static bo_t *GetD263Tag( void )
{
bo_t *d263;
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;
case VLC_FOURCC('H','2','6','3'):
{
- bo_t *d263 = GetD263Tag( p_stream );
+ bo_t *d263 = GetD263Tag();
box_fix( d263 );
box_gather( vide, d263 );
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" );
}
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 );
*****************************************************************************/
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;
- }
+ }
}
/*****************************************************************************
/* 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];
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++ )
{
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;
*****************************************************************************/
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" ); /* FIXME not sure */
- return VLC_SUCCESS;
+ case MUX_GET_MIME:
+ ppsz = (char**)va_arg( args, char ** );
+ *ppsz = strdup( "video/mpeg" ); /* FIXME not sure */
+ return VLC_SUCCESS;
default:
return VLC_EGENERIC;
- }
+ }
}
/*****************************************************************************
}
/* Empty all data in chain_pes */
- BufferChainClean( p_mux->p_sout, &p_stream->chain_pes );
+ BufferChainClean( &p_stream->chain_pes );
if( p_stream->lang )
{
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;
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;
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_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:
- ppsz = (char**)va_arg( args, char ** );
- *ppsz = strdup( "multipart/x-mixed-replace; boundary="BOUNDARY );
- return VLC_SUCCESS;
+ case MUX_GET_MIME:
+ ppsz = (char**)va_arg( args, char ** );
+ *ppsz = strdup( "multipart/x-mixed-replace; boundary="BOUNDARY );
+ return VLC_SUCCESS;
default:
return VLC_EGENERIC;
- }
+ }
}
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 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
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++ )
{
/* 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++ )
*****************************************************************************/
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;
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;
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;
block_t *p_og;
ogg_packet op;
- int i;
+ int i;
/* flush all remaining data */
for( i = 0; i < p_mux->i_nb_inputs; i++ )
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++ )
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 );
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_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:
- ppsz = (char**)va_arg( args, char ** );
- *ppsz = strdup( "audio/wav" );
- return VLC_SUCCESS;
+ case MUX_GET_MIME:
+ ppsz = (char**)va_arg( args, char ** );
+ *ppsz = strdup( "audio/wav" );
+ return VLC_SUCCESS;
default:
return VLC_EGENERIC;
- }
+ }
}
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" );
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 ) );
}