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

Function splice_discontinuity

libhb/reader.c:372–408  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370}
371
372static hb_buffer_t * splice_discontinuity( hb_work_private_t *r, hb_buffer_t *buf )
373{
374 // Handle buffers that were split across a PCR discontinuity.
375 // Rejoin them into a single buffer.
376 hb_buffer_list_t * list = get_splice_list(r, buf->s.id);
377 if (list != NULL)
378 {
379 hb_buffer_list_append(list, buf);
380 if (buf->s.split)
381 {
382 return NULL;
383 }
384
385 int count = hb_buffer_list_count(list);
386 if (count > 1)
387 {
388 int size = hb_buffer_list_size(list);
389 hb_buffer_t * b = hb_buffer_init(size);
390 buf = hb_buffer_list_head(list);
391 b->s = buf->s;
392
393 int pos = 0;
394 while ((buf = hb_buffer_list_rem_head(list)) != NULL)
395 {
396 memcpy(b->data + pos, buf->data, buf->size);
397 pos += buf->size;
398 hb_buffer_close(&buf);
399 }
400 buf = b;
401 }
402 else
403 {
404 buf = hb_buffer_list_clear(list);
405 }
406 }
407 return buf;
408}
409
410static void push_buf( hb_work_private_t *r, hb_fifo_t *fifo, hb_buffer_t *buf )
411{

Callers 1

reader_workFunction · 0.85

Calls 9

get_splice_listFunction · 0.85
hb_buffer_list_appendFunction · 0.85
hb_buffer_list_countFunction · 0.85
hb_buffer_list_sizeFunction · 0.85
hb_buffer_initFunction · 0.85
hb_buffer_list_headFunction · 0.85
hb_buffer_list_rem_headFunction · 0.85
hb_buffer_closeFunction · 0.85
hb_buffer_list_clearFunction · 0.85

Tested by

no test coverage detected