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

Function reader_work

libhb/reader.c:452–608  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

450}
451
452static int reader_work( hb_work_object_t * w, hb_buffer_t ** buf_in,
453 hb_buffer_t ** buf_out)
454{
455 hb_work_private_t * r = w->private_data;
456 hb_fifo_t ** fifos;
457 hb_buffer_t * buf;
458 hb_buffer_list_t list;
459 int ii, chapter = -1;
460
461 hb_buffer_list_clear(&list);
462
463 if (r->bd)
464 chapter = hb_bd_chapter( r->bd );
465 else if (r->dvd)
466 chapter = hb_dvd_chapter( r->dvd );
467 else if (r->stream)
468 chapter = hb_stream_chapter( r->stream );
469
470 if( chapter < 0 )
471 {
472 hb_log( "reader: end of the title reached" );
473 reader_send_eof(r);
474 return HB_WORK_DONE;
475 }
476 if( chapter > r->chapter_end )
477 {
478 hb_log("reader: end of chapter %d (media %d) reached at media chapter %d",
479 r->job->chapter_end, r->chapter_end, chapter);
480 reader_send_eof(r);
481 return HB_WORK_DONE;
482 }
483
484 if (r->bd)
485 {
486 if( (buf = hb_bd_read( r->bd )) == NULL )
487 {
488 reader_send_eof(r);
489 return HB_WORK_DONE;
490 }
491 }
492 else if (r->dvd)
493 {
494 if( (buf = hb_dvd_read( r->dvd )) == NULL )
495 {
496 reader_send_eof(r);
497 return HB_WORK_DONE;
498 }
499 }
500 else if (r->stream)
501 {
502 if ( (buf = hb_stream_read( r->stream )) == NULL )
503 {
504 reader_send_eof(r);
505 return HB_WORK_DONE;
506 }
507 }
508 else
509 {

Callers

nothing calls this directly

Calls 15

hb_buffer_list_clearFunction · 0.85
hb_bd_chapterFunction · 0.85
hb_dvd_chapterFunction · 0.85
hb_stream_chapterFunction · 0.85
hb_logFunction · 0.85
reader_send_eofFunction · 0.85
hb_bd_readFunction · 0.85
hb_dvd_readFunction · 0.85
hb_stream_readFunction · 0.85
hb_errorFunction · 0.85
hb_buffer_list_rem_headFunction · 0.85
GetFifoForIdFunction · 0.85

Tested by

no test coverage detected