changeset 8973:34f2c7189710 libavcodec

Add key_frame to AVCodecParserContext, used in libavformat. Initialized to -1 in parser.c for backward compatibility. Patch by Ivan Schreter, schreter gmx net
author cehoyos
date Wed, 18 Feb 2009 23:46:05 +0000
parents eaf39f9b25df
children d7968d68b2a5
files avcodec.h parser.c
diffstat 2 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/avcodec.h	Wed Feb 18 23:33:30 2009 +0000
+++ b/avcodec.h	Wed Feb 18 23:46:05 2009 +0000
@@ -30,7 +30,7 @@
 #include "libavutil/avutil.h"
 
 #define LIBAVCODEC_VERSION_MAJOR 52
-#define LIBAVCODEC_VERSION_MINOR 15
+#define LIBAVCODEC_VERSION_MINOR 16
 #define LIBAVCODEC_VERSION_MICRO  0
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
@@ -3025,6 +3025,14 @@
 
     int64_t offset;      ///< byte offset from starting packet start
     int64_t cur_frame_end[AV_PARSER_PTS_NB];
+
+    /*!
+     * Set by parser to 1 for key frames and 0 for non-key frames.
+     * It is initialized to -1, so if the parser doesn't set this flag,
+     * old-style fallback using FF_I_TYPE picture type as key frames
+     * will be used.
+     */
+    int key_frame;
 } AVCodecParserContext;
 
 typedef struct AVCodecParser {
--- a/parser.c	Wed Feb 18 23:33:30 2009 +0000
+++ b/parser.c	Wed Feb 18 23:46:05 2009 +0000
@@ -73,6 +73,7 @@
     }
     s->fetch_timestamp=1;
     s->pict_type = FF_I_TYPE;
+    s->key_frame = -1;
     return s;
 }