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

Function DecodePreviews

libhb/scan.c:651–1429  ·  view source on GitHub ↗

* DecodePreviews *********************************************************************** * Decode 10 pictures for the given title. * It assumes that data->reader and data->vts have successfully been * DVDOpen()ed and ifoOpen()ed. **********************************************************************/

Source from the content-addressed store, hash-verified

649 * DVDOpen()ed and ifoOpen()ed.
650 **********************************************************************/
651static int DecodePreviews( hb_scan_t * data, hb_title_t * title, int flush )
652{
653 int i, npreviews = 0, abort = 0;
654 hb_buffer_t * buf, * buf_es;
655 hb_buffer_list_t list_es;
656 int progressive_count = 0;
657 int pulldown_count = 0;
658 int doubled_frame_count = 0;
659 int interlaced_preview_count = 0;
660 int vid_samples = 0;
661 int frame_wait = 0;
662 int cc_wait = 10;
663 int frames;
664 hb_stream_t * stream = NULL;
665 info_list_t * info_list;
666 int abort_audio = 0;
667
668 info_list = calloc(data->preview_count+1, sizeof(*info_list));
669 crop_record_t *crops = crop_record_init( data->preview_count );
670
671 hb_buffer_list_clear(&list_es);
672
673 if( data->batch )
674 {
675 hb_log( "scan: decoding previews for title %d (%s)", title->index, title->path );
676 }
677 else
678 {
679 hb_log( "scan: decoding previews for title %d", title->index );
680 }
681
682 if (data->bd)
683 {
684 hb_bd_start( data->bd, title );
685 hb_log( "scan: title angle(s) %d", title->angle_count );
686 }
687 else if (data->dvd)
688 {
689 hb_dvd_start( data->dvd, title, 1 );
690 title->angle_count = hb_dvd_angle_count( data->dvd );
691 hb_log( "scan: title angle(s) %d", title->angle_count );
692 }
693 else // data->batch or a single file
694 {
695 stream = hb_stream_open(data->h, title->path, title, 0);
696 }
697
698 if (data->bd == NULL && data->dvd == NULL && stream == NULL)
699 {
700 hb_error("Can't open stream!");
701 free(info_list);
702 crop_record_free(crops);
703 hb_stream_close(&stream);
704 return 0;
705 }
706
707 if (title->video_codec == WORK_NONE)
708 {

Callers 1

ScanFuncFunction · 0.85

Calls 15

crop_record_initFunction · 0.85
hb_buffer_list_clearFunction · 0.85
hb_logFunction · 0.85
hb_bd_startFunction · 0.85
hb_dvd_startFunction · 0.85
hb_dvd_angle_countFunction · 0.85
hb_stream_openFunction · 0.85
hb_errorFunction · 0.85
crop_record_freeFunction · 0.85
hb_stream_closeFunction · 0.85
hb_get_hwaccelFunction · 0.85
hb_hwaccel_is_availableFunction · 0.85

Tested by

no test coverage detected