pv->packet_info.dts = parser_dts;
decodeFrame(w, &pv->packet_info);
+ w->frame_count++;
// There could have been an unfinished packet when we entered
// decodeVideo that is now finished. The next packet is associated
uint64_t min_title_duration;
} hb_scan_t;
-#define PREVIEW_READ_THRESH (1024 * 1024 * 300)
+#define PREVIEW_READ_THRESH (200)
static void ScanFunc( void * );
static int DecodePreviews( hb_scan_t *, hb_title_t * title, int flush );
hb_buffer_t * vid_buf = NULL;
- int total_read = 0, packets = 0;
- while (total_read < PREVIEW_READ_THRESH ||
+ int packets = 0;
+ vid_decoder->frame_count = 0;
+ while (vid_decoder->frame_count < PREVIEW_READ_THRESH ||
(!AllAudioOK(title) && packets < 10000))
{
if (data->bd)
abort = 1;
goto skip_preview;
}
- total_read += buf->size;
packets++;
(hb_demux[title->demuxer])(buf, &list_es, 0 );