]> granicus.if.org Git - handbrake/commitdiff
scan: enable HBTF_NO_IDR when not enough previews found
authorJohn Stebbins <jstebbins.hb@gmail.com>
Tue, 11 Apr 2017 18:23:56 +0000 (12:23 -0600)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Tue, 11 Apr 2017 18:27:54 +0000 (12:27 -0600)
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

(cherry picked from commit 7e346baaa3ce8df0b03ab64ce78434aa68a8b5d3)

libhb/scan.c

index da7379c0f0318cc98ba48902ad1e99b751a604b6..ce59ac7aa00a04da9b5f00f45c5169bfa8c9a036 100644 (file)
@@ -222,6 +222,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)