MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / hb_stream_check_for_ts

Function hb_stream_check_for_ts

libhb/stream.c:529–549  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

527}
528
529static int hb_stream_check_for_ts(const uint8_t *buf)
530{
531 // transport streams should have a sync byte every 188 bytes.
532 // search the first 8KB of buf looking for at least 8 consecutive
533 // correctly located sync patterns.
534 int offset = 0;
535 int count = 16;
536
537 for ( offset = 0; offset < 8*1024-count*188; ++offset )
538 {
539 if ( have_ts_sync( &buf[offset], 188, count) )
540 return 188 | (offset << 8);
541 if ( have_ts_sync( &buf[offset], 192, count) )
542 return 192 | (offset << 8);
543 if ( have_ts_sync( &buf[offset], 204, count) )
544 return 204 | (offset << 8);
545 if ( have_ts_sync( &buf[offset], 208, count) )
546 return 208 | (offset << 8);
547 }
548 return 0;
549}
550
551static int hb_stream_check_for_ps(hb_stream_t *stream)
552{

Callers 1

hb_stream_get_typeFunction · 0.85

Calls 1

have_ts_syncFunction · 0.70

Tested by

no test coverage detected