summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-12-06 16:49:00 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-16 00:35:12 +0100
commit3488e9e269f83ed1a8aec10f75d779176c939e11 (patch)
treeca520c52801c30c5128503e9f8419805c326941c /libavcodec
parent5a8d78ab7f5444fa690503e9cd39fd25416a8338 (diff)
downloadffmpeg-3488e9e269f83ed1a8aec10f75d779176c939e11.tar.gz
avcodec/error_resilience: factor er_supported() check out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit afb18c55783362546b5e512ce01b7fe7bf5744d9) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/error_resilience.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c
index 70a800a746..de84d84cc6 100644
--- a/libavcodec/error_resilience.c
+++ b/libavcodec/error_resilience.c
@@ -762,6 +762,17 @@ void ff_er_frame_start(ERContext *s)
s->error_occurred = 0;
}
+static int er_supported(ERContext *s)
+{
+ if(s->avctx->hwaccel ||
+ s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU ||
+ !s->cur_pic ||
+ s->cur_pic->field_picture
+ )
+ return 0;
+ return 1;
+}
+
/**
* Add a slice.
* @param endx x component of the last macroblock, can be -1
@@ -851,9 +862,7 @@ void ff_er_frame_end(ERContext *s)
* though it should not crash if enabled. */
if (!s->avctx->err_recognition || s->error_count == 0 ||
s->avctx->lowres ||
- s->avctx->hwaccel ||
- s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU ||
- !s->cur_pic || s->cur_pic->field_picture ||
+ !er_supported(s) ||
s->error_count == 3 * s->mb_width *
(s->avctx->skip_top + s->avctx->skip_bottom)) {
return;