Browse Source

demux: ts: don't split pkt on overflow for aligned cases

useless as the startcode always lies in first bytes
if there's no PUSI violation
pull/162/head
François Cartegnie 3 years ago
committed by Steve Lhomme
parent
commit
32bd499b12
  1. 5
      modules/demux/mpeg/ts_pes.c
  2. 2
      test/modules/demux/ts_pes.c

5
modules/demux/mpeg/ts_pes.c

@ -268,8 +268,9 @@ bool ts_pes_Gather( ts_pes_parse_callback *cb,
assert( p_pes->gather.i_data_size > p_pes->gather.i_gathered ||
p_pes->gather.i_data_size == 0 );
/* If we started reading a fixed size */
if( p_pes->gather.i_data_size > p_pes->gather.i_gathered && !b_single_payload )
/* If we started reading a fixed size that might not end on boundary */
if( unlikely(!b_aligned_ts_payload) &&
p_pes->gather.i_data_size > p_pes->gather.i_gathered )
{
const size_t i_remain = p_pes->gather.i_data_size - p_pes->gather.i_gathered;
/* Append whole block */

2
test/modules/demux/ts_pes.c

@ -173,7 +173,7 @@ int main(void)
ASSERT(output);
block_ChainProperties(output, &outputcount, &outputsize, NULL);
ASSERT(outputcount == 1);
ASSERT(outputsize == 256);
ASSERT(outputsize == 300);
RESET;
/* no packets assembly from unit start, early termination by fixed size */

Loading…
Cancel
Save