summaryrefslogtreecommitdiff
path: root/libavcodec/h264_slice.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2015-03-31 10:35:15 +0200
committerAnton Khirnov <anton@khirnov.net>2015-04-03 13:14:43 +0200
commita4d34e218f548d381e09c483e8dc6ad18a8d571c (patch)
treebbd5fa30bade6bd43b1c7db67665baf154acb359 /libavcodec/h264_slice.c
parent3892bdab9b652eb003ab95e167f1765e0b0ea035 (diff)
h264: disable ER by default
The way it is currently designed is fundamentally unsafe and cannot be reasonably fixed without completely rewriting it.
Diffstat (limited to 'libavcodec/h264_slice.c')
-rw-r--r--libavcodec/h264_slice.c6
1 files changed, 5 insertions, 1 deletions
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