diff --git a/modules/mux/mpeg/ts.c b/modules/mux/mpeg/ts.c index dc95ecd06d905981c0b6f8020346dfb778873e46..e3b8c04c46c1edf51d80994e862da68988852d51 100644 --- a/modules/mux/mpeg/ts.c +++ b/modules/mux/mpeg/ts.c @@ -2094,19 +2094,19 @@ static block_t *TSNew( sout_mux_t *p_mux, ts_stream_t *p_stream, int i_stuffing_start = b_splicing_point ? 7 : 6; p_ts->p_buffer[4] = i_stuffing + (b_splicing_point ? 2 : -1); - if( i_stuffing > 1 ) + p_ts->p_buffer[5] = 0x00; + if( b_splicing_point ) { - p_ts->p_buffer[5] = 0x00; - if( b_splicing_point ) - { - p_ts->p_buffer[5] |= 0x04; /* flag splicing point */ - /* in (+) or out (-) point */ - p_ts->p_buffer[6] = p_stream->i_splice_countdown > 0 ? - (0x80 | (p_stream->i_splice_countdown & 0x7f)) : 0; - p_stream->b_splicing_point = (p_stream->i_splice_countdown >= 127) ? false : true; - p_stream->i_splice_countdown++; - } + p_ts->p_buffer[5] |= 0x04; /* flag splicing point */ + /* in (+) or out (-) point */ + p_ts->p_buffer[6] = p_stream->i_splice_countdown > 0 ? + (0x80 | (p_stream->i_splice_countdown & 0x7f)) : 0; + p_stream->b_splicing_point = (p_stream->i_splice_countdown >= 127) ? false : true; + p_stream->i_splice_countdown++; + } + if( i_stuffing > 1 ) + { for( i = i_stuffing_start; i < i_stuffing_start + i_stuffing; i++ ) { p_ts->p_buffer[i] = 0xff;