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

modules/mux/mpeg/ts.c: Fix adaptation field length without splicing point.

The adaptation field size was not correct in the case that there was no splicing point. This
resulted in corrupt TS packets.
parent 23b13015
......@@ -2091,7 +2091,9 @@ static block_t *TSNew( sout_mux_t *p_mux, ts_stream_t *p_stream,
int i_stuffing = i_payload_max - i_payload;
int i_stuffing_start = b_splicing_point ? 7 : 6;
p_ts->p_buffer[4] = i_stuffing + (b_splicing_point ? 2 : 1);
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 )
{
......@@ -2109,6 +2111,7 @@ static block_t *TSNew( sout_mux_t *p_mux, ts_stream_t *p_stream,
}
}
}
}
/* copy payload */
memcpy( &p_ts->p_buffer[188 - i_payload],
......
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