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

Function parse_pack_header

libhb/stream.c:3271–3304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3269}
3270
3271static int parse_pack_header(
3272 hb_stream_t *stream,
3273 bitbuf_t *bb,
3274 hb_pes_info_t *pes_info )
3275{
3276 if ( bits_bytes_left(bb) < 12)
3277 {
3278 return 0;
3279 }
3280
3281 bits_skip(bb, 8 * 4);
3282 int mark = bits_get(bb, 2);
3283
3284 if ( mark == 0x00 )
3285 {
3286 // mpeg1 pack
3287 bits_skip(bb, 2); // marker
3288 }
3289 pes_info->scr = parse_pes_timestamp( bb );
3290
3291 if ( mark == 0x00 )
3292 {
3293 bits_skip(bb, 24);
3294 pes_info->header_len = (bb->pos >> 3);
3295 }
3296 else
3297 {
3298 bits_skip(bb, 39);
3299 int stuffing = bits_get(bb, 3);
3300 pes_info->header_len = stuffing;
3301 pes_info->header_len += (bb->pos >> 3);
3302 }
3303 return 1;
3304}
3305
3306// Returns the length of the header
3307static int hb_parse_ps(

Callers 1

hb_parse_psFunction · 0.85

Calls 4

bits_bytes_leftFunction · 0.85
bits_skipFunction · 0.85
bits_getFunction · 0.85
parse_pes_timestampFunction · 0.85

Tested by

no test coverage detected