diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2008-02-20 03:20:06 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2008-02-20 03:20:06 +0000 |
commit | ff2635b273269dff524bc89242902011b68794ff (patch) | |
tree | f643dca3a71abc8308fde12d4bd65c34997427d6 /libavcodec | |
parent | 8815bf011e309aea8774a0cd584cbfadc16558c0 (diff) | |
download | ffmpeg-ff2635b273269dff524bc89242902011b68794ff.tar.gz |
Make timestamp interpolation work with mpeg2 field pictures.
Cleaner/simpler solutions are welcome.
Originally committed as revision 12156 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/avcodec.h | 1 | ||||
-rw-r--r-- | libavcodec/mpegvideo_parser.c | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 8870fded3f..44f45f2330 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -2788,6 +2788,7 @@ typedef struct AVCodecParserContext { /* video info */ int pict_type; /* XXX: Put it back in AVCodecContext. */ int repeat_pict; /* XXX: Put it back in AVCodecContext. */ + int parity; int64_t pts; /* pts of the current frame */ int64_t dts; /* dts of the current frame */ diff --git a/libavcodec/mpegvideo_parser.c b/libavcodec/mpegvideo_parser.c index 8beaeb41ab..cc423b7288 100644 --- a/libavcodec/mpegvideo_parser.c +++ b/libavcodec/mpegvideo_parser.c @@ -36,6 +36,7 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s, int horiz_size_ext, vert_size_ext, bit_rate_ext; //FIXME replace the crap with get_bits() s->repeat_pict = 0; + s->parity = 0; buf_end = buf + buf_size; while (buf < buf_end) { start_code= -1; @@ -105,8 +106,11 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s, /* the packet only represents half a frame XXX,FIXME maybe find a different solution */ - if(picture_structure != 3) + if(picture_structure != 3){ s->repeat_pict = -1; + s->parity = picture_structure-1; + }else + s->parity = !top_field_first; } break; } |