From a4d34e218f548d381e09c483e8dc6ad18a8d571c Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Tue, 31 Mar 2015 10:35:15 +0200 Subject: h264: disable ER by default The way it is currently designed is fundamentally unsafe and cannot be reasonably fixed without completely rewriting it. --- libavcodec/h264_slice.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libavcodec/h264_slice.c') diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index 047dbaef0a..3f0d40255e 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -530,6 +530,7 @@ int ff_h264_update_thread_context(AVCodecContext *dst, return ret; } + h->enable_er = h1->enable_er; h->workaround_bugs = h1->workaround_bugs; h->low_delay = h1->low_delay; h->droppable = h1->droppable; @@ -633,7 +634,7 @@ static int h264_frame_start(H264Context *h) if ((ret = ff_h264_ref_picture(h, &h->cur_pic, h->cur_pic_ptr)) < 0) return ret; - if (CONFIG_ERROR_RESILIENCE) + if (CONFIG_ERROR_RESILIENCE && h->enable_er) ff_er_frame_start(&h->slice_ctx[0].er); for (i = 0; i < 16; i++) { @@ -2061,6 +2062,9 @@ static void er_add_slice(H264SliceContext *sl, #if CONFIG_ERROR_RESILIENCE ERContext *er = &sl->er; + if (!sl->h264->enable_er) + return; + er->ref_count = sl->ref_count[0]; ff_er_add_slice(er, startx, starty, endx, endy, status); #endif -- cgit v1.2.3