Skip to content
Snippets Groups Projects
Commit 4b7356ce authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

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: default avatarMichael Niedermayer <michaelni@gmx.at>
parent 6da7625c
No related branches found
No related tags found
No related merge requests found
...@@ -702,9 +702,12 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx) ...@@ -702,9 +702,12 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx)
ff_h264_flush_change(h); 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) { if (h->enable_er) {
av_log(avctx, AV_LOG_WARNING, 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"); "Use it at your own risk\n");
} }
...@@ -1936,7 +1939,7 @@ static av_cold int h264_decode_end(AVCodecContext *avctx) ...@@ -1936,7 +1939,7 @@ static av_cold int h264_decode_end(AVCodecContext *avctx)
static const AVOption h264_options[] = { static const AVOption h264_options[] = {
{"is_avc", "is avc", offsetof(H264Context, is_avc), FF_OPT_TYPE_INT, {.i64 = 0}, 0, 1, 0}, {"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}, {"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 }, { NULL },
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment