From: John Stebbins Date: Tue, 11 Apr 2017 18:23:56 +0000 (-0600) Subject: scan: enable HBTF_NO_IDR when not enough previews found X-Git-Tag: 1.1.0~597 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7e346baaa3ce8df0b03ab64ce78434aa68a8b5d3;p=handbrake 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 --- 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)