[FFmpeg-cvslog] avcodec/h264: reenable ER except with slice threads by default

Michael Niedermayer git at videolan.org
Sat Apr 4 01:45:01 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Apr  4 01:02:29 2015 +0200| [4b7356ce8f2c7902a9b97645f86e0ae09bc2676c] | committer: Michael Niedermayer

avcodec/h264: reenable ER except with slice threads by default

ER with slice threads is buggy and since the merge of the libav cleanup broken
as the ER context which is supposed to be per frame has been placed in
the slice context, so there are multiple per frame which does not work as is.

Theres no bug report about ER with frame threads. If someone knows of a
case where it crashes / fails without slice threads please mail me and
open a ticket on trac.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4b7356ce8f2c7902a9b97645f86e0ae09bc2676c
---

 libavcodec/h264.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index a795597..11f1055 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -702,9 +702,12 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx)
 
     ff_h264_flush_change(h);
 
+    if (h->enable_er < 0 && (avctx->active_thread_type & FF_THREAD_SLICE))
+        h->enable_er = 0;
+
     if (h->enable_er) {
         av_log(avctx, AV_LOG_WARNING,
-               "Error resilience is enabled. It is unsafe and unsupported and may crash. "
+               "Error resilience with slice threads is enabled. It is unsafe and unsupported and may crash. "
                "Use it at your own risk\n");
     }
 
@@ -1936,7 +1939,7 @@ static av_cold int h264_decode_end(AVCodecContext *avctx)
 static const AVOption h264_options[] = {
     {"is_avc", "is avc", offsetof(H264Context, is_avc), FF_OPT_TYPE_INT, {.i64 = 0}, 0, 1, 0},
     {"nal_length_size", "nal_length_size", offsetof(H264Context, nal_length_size), FF_OPT_TYPE_INT, {.i64 = 0}, 0, 4, 0},
-    { "enable_er", "Enable error resilience on damaged frames (unsafe)", OFFSET(enable_er), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VD },
+    { "enable_er", "Enable error resilience on damaged frames (unsafe)", OFFSET(enable_er), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VD },
     { NULL },
 };
 



More information about the ffmpeg-cvslog mailing list