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

Function hb_fifo_see_wait

libhb/fifo.c:1323–1342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1321}
1322
1323hb_buffer_t * hb_fifo_see_wait( hb_fifo_t * f )
1324{
1325 hb_buffer_t * b;
1326
1327 hb_lock( f->lock );
1328 if( f->size < 1 )
1329 {
1330 f->wait_empty = 1;
1331 hb_cond_timedwait( f->cond_empty, f->lock, FIFO_TIMEOUT );
1332 if( f->size < 1 )
1333 {
1334 hb_unlock( f->lock );
1335 return NULL;
1336 }
1337 }
1338 b = f->first;
1339 hb_unlock( f->lock );
1340
1341 return b;
1342}
1343
1344// Returns the first packet in the specified FIFO.
1345// If the FIFO is empty, returns NULL.

Callers

nothing calls this directly

Calls 3

hb_lockFunction · 0.85
hb_cond_timedwaitFunction · 0.85
hb_unlockFunction · 0.85

Tested by

no test coverage detected