aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2005-08-15 15:58:21 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-08-15 15:58:21 +0000
commit7cbaa7bafa16b572aaae692722a9f8db90b65cb8 (patch)
tree050620b8c810b57d2d8d7f2997c6bc0ae511bd0d /libavcodec
parent30bc6613fed9592e81b04818cb3e6c95088460d1 (diff)
downloadffmpeg-7cbaa7bafa16b572aaae692722a9f8db90b65cb8.tar.gz
parse pict_type for streams in avi
fix mpeg4 parser so it outputs te pict_type support header only parseing without repacking Originally committed as revision 4527 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/avcodec.h7
-rw-r--r--libavcodec/parser.c36
2 files changed, 28 insertions, 15 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index d3ed1a7dea..8fadeb7b29 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -21,8 +21,8 @@ extern "C" {
#define AV_STRINGIFY(s) AV_TOSTRING(s)
#define AV_TOSTRING(s) #s
-#define LIBAVCODEC_VERSION_INT ((49<<16)+(0<<8)+1)
-#define LIBAVCODEC_VERSION 49.0.1
+#define LIBAVCODEC_VERSION_INT ((49<<16)+(0<<8)+2)
+#define LIBAVCODEC_VERSION 49.0.2
#define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT
#define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
@@ -2324,6 +2324,9 @@ typedef struct AVCodecParserContext {
int64_t cur_frame_offset[AV_PARSER_PTS_NB];
int64_t cur_frame_pts[AV_PARSER_PTS_NB];
int64_t cur_frame_dts[AV_PARSER_PTS_NB];
+
+ int flags;
+#define PARSER_FLAG_COMPLETE_FRAMES 0x0001
} AVCodecParserContext;
typedef struct AVCodecParser {
diff --git a/libavcodec/parser.c b/libavcodec/parser.c
index 280bb45f57..ed620dbefc 100644
--- a/libavcodec/parser.c
+++ b/libavcodec/parser.c
@@ -429,13 +429,18 @@ static int mpegvideo_parse(AVCodecParserContext *s,
ParseContext1 *pc1 = s->priv_data;
ParseContext *pc= &pc1->pc;
int next;
-
- next= ff_mpeg1_find_frame_end(pc, buf, buf_size);
-
- if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) {
- *poutbuf = NULL;
- *poutbuf_size = 0;
- return buf_size;
+
+ if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){
+ next= buf_size;
+ }else{
+ next= ff_mpeg1_find_frame_end(pc, buf, buf_size);
+
+ if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) {
+ *poutbuf = NULL;
+ *poutbuf_size = 0;
+ return buf_size;
+ }
+
}
/* we have a full frame : we just parse the first few MPEG headers
to have the full timing information. The time take by this
@@ -506,6 +511,7 @@ static int av_mpeg4_decode_header(AVCodecParserContext *s1,
if (s->width) {
avcodec_set_dimensions(avctx, s->width, s->height);
}
+ s1->pict_type= s->pict_type;
pc->first_picture = 0;
return ret;
}
@@ -529,12 +535,16 @@ static int mpeg4video_parse(AVCodecParserContext *s,
ParseContext *pc = s->priv_data;
int next;
- next= ff_mpeg4_find_frame_end(pc, buf, buf_size);
-
- if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) {
- *poutbuf = NULL;
- *poutbuf_size = 0;
- return buf_size;
+ if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){
+ next= buf_size;
+ }else{
+ next= ff_mpeg4_find_frame_end(pc, buf, buf_size);
+
+ if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) {
+ *poutbuf = NULL;
+ *poutbuf_size = 0;
+ return buf_size;
+ }
}
av_mpeg4_decode_header(s, avctx, buf, buf_size);