summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libhb/scan.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/libhb/scan.c b/libhb/scan.c
index e638ebc54..74d960117 100644
--- a/libhb/scan.c
+++ b/libhb/scan.c
@@ -596,7 +596,20 @@ static int DecodePreviews( hb_scan_t * data, hb_title_t * title, int flush )
vid_decoder->flush( vid_decoder );
if (title->flags & HBTF_NO_IDR)
{
- frame_wait = 100;
+ if (!flush)
+ {
+ // If we are doing the first previews decode attempt,
+ // set this threshold high so that we get the best
+ // quality frames possible.
+ frame_wait = 100;
+ }
+ else
+ {
+ // If we failed to get enough valid frames in the first
+ // previews decode attempt, lower the threshold to improve
+ // our chances of getting something to work with.
+ frame_wait = 10;
+ }
}
hb_buffer_t * vid_buf = NULL;