[FFmpeg-devel] [PATCH 1/2] avcodec: add decode_error field to AVFrame

Marton Balint cus at passwd.hu
Sun Jul 8 18:12:08 CEST 2012


Signed-off-by: Marton Balint <cus at passwd.hu>
---
 doc/APIchanges       |    3 +++
 libavcodec/avcodec.h |   13 +++++++++++++
 libavcodec/utils.c   |    1 +
 libavcodec/version.h |    2 +-
 4 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 6d8ad74..ef07682 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil:     2011-04-18
 
 API changes, most recent first:
 
+2012-07-08 - xxxxxxx - lavc 54.34.100
+  Add decode_error field to AVFrame.
+
 2012-06-26 - xxxxxxx - lavu 51.63.100 - imgutils.h
   Add functions to libavutil/imgutils.h:
   av_image_get_buffer_size()
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index c850963..150f89b 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1311,6 +1311,17 @@ typedef struct AVFrame {
      * - decoding: Read by user.
      */
     int64_t pkt_duration;
+
+    /**
+     * decode error flag of the frame, set to a nonzero codec-specific error
+     * code if the decoder produced a frame, but there were errors during
+     * the decoding.
+     * Code outside libavcodec should access this field using:
+     * av_frame_get_decode_error(frame)
+     * - encoding: unused
+     * - decoding: set by libavcodec, read by user.
+     */
+    int decode_error;
 } AVFrame;
 
 /**
@@ -1323,11 +1334,13 @@ int64_t av_frame_get_pkt_duration         (const AVFrame *frame);
 int64_t av_frame_get_pkt_pos              (const AVFrame *frame);
 int64_t av_frame_get_channel_layout       (const AVFrame *frame);
 int     av_frame_get_sample_rate          (const AVFrame *frame);
+int     av_frame_get_decode_error         (const AVFrame *frame);
 void    av_frame_set_best_effort_timestamp(AVFrame *frame, int64_t val);
 void    av_frame_set_pkt_duration         (AVFrame *frame, int64_t val);
 void    av_frame_set_pkt_pos              (AVFrame *frame, int64_t val);
 void    av_frame_set_channel_layout       (AVFrame *frame, int64_t val);
 void    av_frame_set_sample_rate          (AVFrame *frame, int     val);
+void    av_frame_set_decode_error         (AVFrame *frame, int     val);
 
 struct AVCodecInternal;
 
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index b3af77d..05f3ff2 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -713,6 +713,7 @@ MAKE_ACCESSORS(AVFrame, frame, int64_t, pkt_duration)
 MAKE_ACCESSORS(AVFrame, frame, int64_t, pkt_pos)
 MAKE_ACCESSORS(AVFrame, frame, int64_t, channel_layout)
 MAKE_ACCESSORS(AVFrame, frame, int,     sample_rate)
+MAKE_ACCESSORS(AVFrame, frame, int,     decode_error)
 
 static void avcodec_get_subtitle_defaults(AVSubtitle *sub)
 {
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 64c1dc6..c513607 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -27,7 +27,7 @@
  */
 
 #define LIBAVCODEC_VERSION_MAJOR 54
-#define LIBAVCODEC_VERSION_MINOR  33
+#define LIBAVCODEC_VERSION_MINOR  34
 #define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
-- 
1.7.3.4



More information about the ffmpeg-devel mailing list