summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2017-04-11 12:23:56 -0600
committerJohn Stebbins <[email protected]>2017-04-11 12:27:22 -0600
commit7e346baaa3ce8df0b03ab64ce78434aa68a8b5d3 (patch)
tree82ee1e613ae8c7dcec3f35f89281abbdfced1e3b /libhb
parentf09dc2daecdd2567eb860a6491d0f7b6c9cb289a (diff)
scan: enable HBTF_NO_IDR when not enough previews found
Setting this flag signals to libav to not wait for IDR or recovery points before returning frames to us. Some videos have neither IDRs or recovery points, so this fixes transcoding such video. Fixes https://github.com/HandBrake/HandBrake/issues/456
Diffstat (limited to 'libhb')
-rw-r--r--libhb/scan.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libhb/scan.c b/libhb/scan.c
index 663ddc6f1..8b5c5d47a 100644
--- a/libhb/scan.c
+++ b/libhb/scan.c
@@ -223,6 +223,10 @@ static void ScanFunc( void * _data )
npreviews = DecodePreviews( data, title, 1 );
if (npreviews < 2)
{
+ // Try harder to get some valid frames
+ // Allow libav to return "corrupt" frames
+ hb_log("scan: Too few previews (%d), trying harder", npreviews);
+ title->flags |= HBTF_NO_IDR;
npreviews = DecodePreviews( data, title, 0 );
}
if (npreviews == 0)