Commit 8917116d authored by Rafaël Carré's avatar Rafaël Carré

TS mux: reduce indentation

parent c42b122e
......@@ -1271,30 +1271,22 @@ static int Mux( sout_mux_t *p_mux )
for (;;)
{
sout_buffer_chain_t chain_ts;
int i_packet_count;
int i_packet_pos;
mtime_t i_pcr_dts;
mtime_t i_pcr_length;
mtime_t i_shaping_delay;
mtime_t i_shaping_delay = p_pcr_stream->b_key_frame
? p_pcr_stream->i_pes_length
: p_sys->i_shaping_delay;
if( p_pcr_stream->b_key_frame )
{
i_shaping_delay = p_pcr_stream->i_pes_length;
}
else
{
i_shaping_delay = p_sys->i_shaping_delay;
}
/* 1: get enough PES packet for all input */
for (;;)
{
bool b_ok = true;
/* Accumulate enough data in the pcr stream (>i_shaping_delay) */
/* Accumulate enough data in all other stream ( >= length of pcr)*/
for (int i = -1; i < p_mux->i_nb_inputs; i++ )
for (int i = -1; !b_ok || i < p_mux->i_nb_inputs; i++ )
{
if (i == p_mux->i_nb_inputs)
{
/* get enough PES packet for all input */
b_ok = true;
i = -1;
}
sout_input_t *p_input;
ts_stream_t *p_stream;
int64_t i_spu_delay = 0;
......@@ -1514,20 +1506,14 @@ static int Mux( sout_mux_t *p_mux )
}
}
if( b_ok )
{
break;
}
}
/* save */
i_pcr_dts = p_pcr_stream->i_pes_dts;
i_pcr_length = p_pcr_stream->i_pes_length;
mtime_t i_pcr_dts = p_pcr_stream->i_pes_dts;
mtime_t i_pcr_length = p_pcr_stream->i_pes_length;
p_pcr_stream->b_key_frame = 0;
/* msg_Dbg( p_mux, "starting muxing %lldms", i_pcr_length / 1000 ); */
/* 2: calculate non accurate total size of muxed ts */
i_packet_count = 0;
int i_packet_count = 0;
for (int i = 0; i < p_mux->i_nb_inputs; i++ )
{
ts_stream_t *p_stream = (ts_stream_t*)p_mux->pp_inputs[i]->p_sys;
......@@ -1560,7 +1546,7 @@ static int Mux( sout_mux_t *p_mux )
/* append PAT/PMT -> FIXME with big pcr delay it won't have enough pat/pmt */
GetPAT( p_mux, &chain_ts );
GetPMT( p_mux, &chain_ts );
i_packet_pos = 0;
int i_packet_pos = 0;
i_packet_count += chain_ts.i_depth;
/* msg_Dbg( p_mux, "estimated pck=%d", i_packet_count ); */
......
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