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

Function hb_fifo_push

libhb/fifo.c:1436–1470  ·  view source on GitHub ↗

Appends the specified packet list to the end of the specified FIFO.

Source from the content-addressed store, hash-verified

1434
1435// Appends the specified packet list to the end of the specified FIFO.
1436void hb_fifo_push( hb_fifo_t * f, hb_buffer_t * b )
1437{
1438 if( !b )
1439 {
1440 return;
1441 }
1442
1443 hb_lock( f->lock );
1444 if (f->size >= f->capacity &&
1445 f->cond_alert_full != NULL)
1446 {
1447 hb_cond_broadcast( f->cond_alert_full );
1448 }
1449 if( f->size > 0 )
1450 {
1451 f->last->next = b;
1452 }
1453 else
1454 {
1455 f->first = b;
1456 }
1457 f->last = b;
1458 f->size += 1;
1459 while( f->last->next )
1460 {
1461 f->size += 1;
1462 f->last = f->last->next;
1463 }
1464 if( f->wait_empty && f->size >= 1 )
1465 {
1466 f->wait_empty = 0;
1467 hb_cond_signal( f->cond_empty );
1468 }
1469 hb_unlock( f->lock );
1470}
1471
1472// Prepends the specified packet list to the start of the specified FIFO.
1473void hb_fifo_push_head( hb_fifo_t * f, hb_buffer_t * b )

Callers 11

process_filterFunction · 0.85
hb_get_previewFunction · 0.85
fifo_pushFunction · 0.85
hb_work_loopFunction · 0.85
filter_loopFunction · 0.85
push_bufFunction · 0.85
hb_vfr_workFunction · 0.85
cc_send_to_decoderFunction · 0.85
LookForAudioFunction · 0.85
process_filterFunction · 0.85
filter_bufFunction · 0.85

Calls 4

hb_lockFunction · 0.85
hb_cond_broadcastFunction · 0.85
hb_cond_signalFunction · 0.85
hb_unlockFunction · 0.85

Tested by

no test coverage detected