Index: libavcodec/error_resilience.c
===================================================================
--- libavcodec/error_resilience.c	(revision 19088)
+++ libavcodec/error_resilience.c	(working copy)
@@ -845,6 +845,8 @@
     }
     av_log(s->avctx, AV_LOG_INFO, "concealing %d DC, %d AC, %d MV errors\n", dc_error, ac_error, mv_error);
 
+    s->avctx->decode_error_count += dc_error + ac_error + mv_error;
+
     is_intra_likely= is_intra_more_likely(s);
 
     /* set unknown mb-type to most likely */
Index: libavcodec/avcodec.h
===================================================================
--- libavcodec/avcodec.h	(revision 19088)
+++ libavcodec/avcodec.h	(working copy)
@@ -2510,6 +2510,13 @@
      * - decoding: Set by libavcodec
      */
      enum AVChromaLocation chroma_sample_location;
+
+     /**
+      * Counts the number of decoding errors
+      */
+#define FFMPEG_HAS_DECODE_ERROR_COUNT  1
+     unsigned decode_error_count;
+
 } AVCodecContext;
 
 /**
