Commit f54b735a authored by Jean-Paul Saman's avatar Jean-Paul Saman

mux/mpeg/ts.c: write splice_countdown field when no pcr, but b_splice_point is true

In case there was no pcr but a splice point must be generated, then the
adaptation field generation code looked at the stuffing byte size. However
just before deciding an adaptation field was needed the adaptation field
length was properly adjusted to include a splice_countdown field.
parent 297529bf
......@@ -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;
......
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