# HG changeset patch # User alexc # Date 1274847632 0 # Node ID 6d58a4f5e455fad5ab9c35505683980363ff2e13 # Parent 847502a2f85048d5a551bc4dfa1e1ecf4d3b1221 Add an AVSTREAM_PARSE_FULL_ONCE parsing mode to parse headers and combine packets once and only once. diff -r 847502a2f850 -r 6d58a4f5e455 avcodec.h --- a/avcodec.h Tue May 25 23:25:29 2010 +0000 +++ b/avcodec.h Wed May 26 04:20:32 2010 +0000 @@ -30,7 +30,7 @@ #include "libavutil/avutil.h" #define LIBAVCODEC_VERSION_MAJOR 52 -#define LIBAVCODEC_VERSION_MINOR 69 +#define LIBAVCODEC_VERSION_MINOR 70 #define LIBAVCODEC_VERSION_MICRO 0 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ @@ -3649,6 +3649,7 @@ int flags; #define PARSER_FLAG_COMPLETE_FRAMES 0x0001 +#define PARSER_FLAG_ONCE 0x0002 int64_t offset; ///< byte offset from starting packet start int64_t cur_frame_end[AV_PARSER_PTS_NB]; diff -r 847502a2f850 -r 6d58a4f5e455 h264_parser.c --- a/h264_parser.c Tue May 25 23:25:29 2010 +0000 +++ b/h264_parser.c Wed May 26 04:20:32 2010 +0000 @@ -272,6 +272,9 @@ s->dts_ref_dts_delta = INT_MIN; s->pts_dts_delta = INT_MIN; } + if (s->flags & PARSER_FLAG_ONCE) { + s->flags &= PARSER_FLAG_COMPLETE_FRAMES; + } } *poutbuf = buf;