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

Function syncSubtitleWork

libhb/sync.c:3326–3373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3324}
3325
3326static int syncSubtitleWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
3327 hb_buffer_t ** buf_out )
3328{
3329 hb_work_private_t * pv = w->private_data;
3330 hb_buffer_t * in = *buf_in;
3331
3332 if (pv->stream->done)
3333 {
3334 flushStreamsLock(pv->common);
3335 return HB_WORK_DONE;
3336 }
3337 if (in->s.flags & HB_BUF_FLAG_EOF)
3338 {
3339 pv->stream->flush = 1;
3340 // sanitizeSubtitle requires EOF buffer to recognize that
3341 // it needs to flush all subtitles.
3342 hb_list_add(pv->stream->in_queue, hb_buffer_eof_init());
3343 flushStreamsLock(pv->common);
3344 if (pv->common->job->indepth_scan)
3345 {
3346 // When doing subtitle indepth scan, the pipeline ends at sync.
3347 // Terminate job when EOF reached.
3348 *w->done = 1;
3349 }
3350 return HB_WORK_DONE;
3351 }
3352
3353 if (pv->common->job->indepth_scan)
3354 {
3355 // When doing subtitle indepth scan, the pipeline ends at sync,
3356 // do not add the subtitles to the queue
3357 return HB_WORK_OK;
3358 }
3359 else
3360 {
3361 *buf_in = NULL;
3362 }
3363
3364 QueueBuffer(pv->stream, in);
3365 Synchronize(pv->stream);
3366
3367 if (pv->stream->done)
3368 {
3369 flushStreamsLock(pv->common);
3370 return HB_WORK_DONE;
3371 }
3372 return HB_WORK_OK;
3373}
3374
3375hb_work_object_t hb_sync_subtitle =
3376{

Callers

nothing calls this directly

Calls 5

flushStreamsLockFunction · 0.85
hb_list_addFunction · 0.85
hb_buffer_eof_initFunction · 0.85
QueueBufferFunction · 0.85
SynchronizeFunction · 0.85

Tested by

no test coverage detected