[FFmpeg-cvslog] avcodec/error_resilience: factor er_supported() check out

Michael Niedermayer git at videolan.org
Sat Dec 7 14:10:13 CET 2013


ffmpeg | branch: release/2.0 | Michael Niedermayer <michaelni at gmx.at> | Fri Dec  6 16:49:00 2013 +0100| [5c7d6be5f9abcee0179796691b01859cbe7a4d31] | committer: Carl Eugen Hoyos

avcodec/error_resilience: factor er_supported() check out

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit afb18c55783362546b5e512ce01b7fe7bf5744d9)

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

 libavcodec/error_resilience.c |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c
index c9f5e1f..77a9d26 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
@@ -853,9 +864,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;



More information about the ffmpeg-cvslog mailing list