# HG changeset patch # User cehoyos # Date 1235000765 0 # Node ID 34f2c718971024201f4e1ad8da47d684164b6129 # Parent eaf39f9b25df8fae4ec600a633566186ae9ddd6b Add key_frame to AVCodecParserContext, used in libavformat. Initialized to -1 in parser.c for backward compatibility. Patch by Ivan Schreter, schreter gmx net diff -r eaf39f9b25df -r 34f2c7189710 avcodec.h --- 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 { diff -r eaf39f9b25df -r 34f2c7189710 parser.c --- 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; }