Commit f06d95b5 authored by Rafaël Carré's avatar Rafaël Carré

mpeg mux: simplify EStoPES prototype

parent 254a0547
......@@ -316,12 +316,13 @@ static inline int PESHeader( uint8_t *p_hdr, mtime_t i_pts, mtime_t i_dts,
* To allow unbounded PES packets in transport stream
* VIDEO_ES, set to INT_MAX.
*/
int EStoPES ( block_t **pp_pes, block_t *p_es,
void EStoPES ( block_t **pp_pes,
es_format_t *p_fmt, int i_stream_id,
int b_mpeg2, int b_data_alignment, int i_header_size,
int i_max_pes_size )
{
block_t *p_pes;
block_t *p_es = *pp_pes;
block_t *p_pes = NULL;
mtime_t i_pts, i_dts, i_length;
uint8_t *p_data;
......@@ -388,8 +389,6 @@ int EStoPES ( block_t **pp_pes, block_t *p_es,
i_size = p_es->i_buffer;
p_data = p_es->p_buffer;
*pp_pes = p_pes = NULL;
do
{
i_pes_payload = __MIN( i_size, i_max_pes_size );
......@@ -434,15 +433,14 @@ int EStoPES ( block_t **pp_pes, block_t *p_es,
} while( i_size > 0 );
/* Now redate all pes */
i_dts = (*pp_pes)->i_dts;
i_length = (*pp_pes)->i_length / i_pes_count;
for( p_pes = *pp_pes; p_pes != NULL; p_pes = p_pes->p_next )
i_dts = p_pes->i_dts;
i_length = p_pes->i_length / i_pes_count;
while( p_pes )
{
p_pes->i_dts = i_dts;
p_pes->i_length = i_length;
i_dts += i_length;
p_pes = p_pes->p_next;
}
return 0;
}
......@@ -35,7 +35,7 @@
#define PES_PAYLOAD_SIZE_MAX 65500
int EStoPES ( block_t **pp_pes, block_t *p_es,
void EStoPES ( block_t **pp_pes,
es_format_t *p_fmt, int i_stream_id,
int b_mpeg2, int b_data_alignment, int i_header_size,
int i_max_pes_size );
......@@ -513,7 +513,7 @@ static int Mux( sout_mux_t *p_mux )
/* Get and mux a packet */
p_data = block_FifoGet( p_input->p_fifo );
EStoPES ( &p_data, p_data, p_input->p_fmt, p_stream->i_stream_id,
EStoPES ( &p_data, p_input->p_fmt, p_stream->i_stream_id,
p_sys->b_mpeg2, 0, 0, p_sys->i_pes_max_size );
block_ChainAppend( &p_ps, p_data );
......
......@@ -1383,7 +1383,7 @@ static bool MuxStreams(sout_mux_t *p_mux )
p_spu->p_buffer[1] = 1;
p_spu->p_buffer[2] = ' ';
EStoPES( &p_spu, p_spu, p_input->p_fmt,
EStoPES( &p_spu, p_input->p_fmt,
p_stream->i_stream_id, 1, 0, 0, 0 );
p_data->p_next = p_spu;
}
......@@ -1429,7 +1429,7 @@ static bool MuxStreams(sout_mux_t *p_mux )
i_max_pes_size = INT_MAX;
}
EStoPES ( &p_data, p_data, p_input->p_fmt, p_stream->i_stream_id,
EStoPES ( &p_data, p_input->p_fmt, p_stream->i_stream_id,
1, b_data_alignment, i_header_size,
i_max_pes_size );
......
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