diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-04-04 01:02:29 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-04-04 01:43:14 +0200 |
commit | 4b7356ce8f2c7902a9b97645f86e0ae09bc2676c (patch) | |
tree | c1758cb14556257f1783e8be0651b8147615673a | |
parent | 6da7625cc395692a71c99d179cb76eea6e8b27ca (diff) | |
download | ffmpeg-4b7356ce8f2c7902a9b97645f86e0ae09bc2676c.tar.gz |
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@gmx.at>
-rw-r--r-- | libavcodec/h264.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index a795597193..11f1055882 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 }, }; |