summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2015-02-02 19:08:34 +0000
committerjstebbins <[email protected]>2015-02-02 19:08:34 +0000
commited749ed715a9ea7a83bd45bddc1175cf085b0a99 (patch)
tree6d885b17297b98950372fabfbfbb4837db3407d0 /libhb
parent6879158d26de2bda56f41a9e571a312b9085a873 (diff)
scan: improve preview generation for short videos that have no IDRs
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6862 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-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;