Permalink
Browse files

ffmpeg: fix currupt h.264 preview frames

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.
  • Loading branch information...
jstebbins committed Jun 20, 2018
1 parent 8dc6f43 commit 5c67bc7dd3be7e2a0e71c4fe9dc6b871d354091d
Showing with 20 additions and 0 deletions.
  1. +20 −0 contrib/ffmpeg/A02-corrupt-h264-frames.patch
@@ -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;

0 comments on commit 5c67bc7

Please sign in to comment.