]> granicus.if.org Git - handbrake/commitdiff
ffmpeg: fix currupt h.264 preview frames
authorJohn Stebbins <jstebbins.hb@gmail.com>
Wed, 20 Jun 2018 16:10:47 +0000 (09:10 -0700)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Wed, 20 Jun 2018 16:10:47 +0000 (09:10 -0700)
The ffmpeg developers added a "heuristic" to the h.264 recovery point
code I wrote to prevent display of corrupt frames.  The heuristic
doesn't work very reliably, so I've disabled it.

When I get a chance I'll see if I can come up with a better way to
handle what the heuristic was added for.

contrib/ffmpeg/A02-corrupt-h264-frames.patch [new file with mode: 0644]

diff --git a/contrib/ffmpeg/A02-corrupt-h264-frames.patch b/contrib/ffmpeg/A02-corrupt-h264-frames.patch
new file mode 100644 (file)
index 0000000..19ef5fd
--- /dev/null
@@ -0,0 +1,20 @@
+diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c
+index 976044ce2c..0211d71a38 100644
+--- a/libavcodec/h264_refs.c
++++ b/libavcodec/h264_refs.c
+@@ -812,6 +812,7 @@ int ff_h264_execute_ref_pic_marking(H264Context *h)
+         }
+     }
++#if 0
+     if (   err >= 0
+         && h->long_ref_count==0
+         && (   h->short_ref_count<=2
+@@ -822,6 +823,7 @@ int ff_h264_execute_ref_pic_marking(H264Context *h)
+         if(!h->avctx->has_b_frames)
+             h->frame_recovered |= FRAME_RECOVERED_SEI;
+     }
++#endif
+ out:
+     return (h->avctx->err_recognition & AV_EF_EXPLODE) ? err : 0;