Commit 4b444058 authored by Rafaël Carré's avatar Rafaël Carré

TS mux: if/else -> switch/case

cosmetics, reindent
parent 9fcc258c
...@@ -1381,22 +1381,16 @@ static bool MuxStreams(sout_mux_t *p_mux ) ...@@ -1381,22 +1381,16 @@ static bool MuxStreams(sout_mux_t *p_mux )
int i_header_size = 0; int i_header_size = 0;
int i_max_pes_size = 0; int i_max_pes_size = 0;
int b_data_alignment = 0; int b_data_alignment = 0;
if( p_input->p_fmt->i_cat == SPU_ES ) if( p_input->p_fmt->i_cat == SPU_ES ) switch (p_input->p_fmt->i_codec)
{
if( p_input->p_fmt->i_codec == VLC_CODEC_SUBT )
{ {
case VLC_CODEC_SUBT:
/* Prepend header */ /* Prepend header */
p_data = block_Realloc( p_data, 2, p_data = block_Realloc( p_data, 2, p_data->i_buffer );
p_data->i_buffer ); p_data->p_buffer[0] = ( (p_data->i_buffer - 2) >> 8) & 0xff;
p_data->p_buffer[0] = p_data->p_buffer[1] = ( (p_data->i_buffer - 2) ) & 0xff;
( (p_data->i_buffer - 2) >> 8) & 0xff;
p_data->p_buffer[1] =
( (p_data->i_buffer - 2) ) & 0xff;
/* remove trailling \0 if any */ /* remove trailling \0 if any */
if( p_data->i_buffer > 2 && if( p_data->i_buffer > 2 && !p_data->p_buffer[p_data->i_buffer-1] )
p_data->p_buffer[p_data->i_buffer -1] ==
'\0' )
p_data->i_buffer--; p_data->i_buffer--;
/* Append a empty sub (sub text only) */ /* Append a empty sub (sub text only) */
...@@ -1413,24 +1407,22 @@ static bool MuxStreams(sout_mux_t *p_mux ) ...@@ -1413,24 +1407,22 @@ static bool MuxStreams(sout_mux_t *p_mux )
p_spu->p_buffer[1] = 1; p_spu->p_buffer[1] = 1;
p_spu->p_buffer[2] = ' '; p_spu->p_buffer[2] = ' ';
EStoPES( p_mux->p_sout, &p_spu, p_spu, EStoPES( p_mux->p_sout, &p_spu, p_spu, p_input->p_fmt,
p_input->p_fmt, p_stream->i_stream_id, 1, 0, 0, 0 );
p_stream->i_stream_id, 1,
0, 0, 0 );
p_data->p_next = p_spu; p_data->p_next = p_spu;
} }
} break;
else if( p_input->p_fmt->i_codec == VLC_CODEC_TELETEXT )
{ case VLC_CODEC_TELETEXT:
/* EN 300 472 */ /* EN 300 472 */
i_header_size = 0x24; i_header_size = 0x24;
b_data_alignment = 1; b_data_alignment = 1;
} break;
else if( p_input->p_fmt->i_codec == VLC_CODEC_DVBS )
{ case VLC_CODEC_DVBS:
/* EN 300 743 */ /* EN 300 743 */
b_data_alignment = 1; b_data_alignment = 1;
} break;
} }
else if( p_data->i_length < 0 || p_data->i_length > 2000000 ) else if( p_data->i_length < 0 || p_data->i_length > 2000000 )
{ {
......
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