# HG changeset patch # User michael # Date 1203477606 0 # Node ID 9f4f88218b788df53bac482196fa17e909f39a1d # Parent 99823c80a93dd95fa7f17e54fde165dc70e3ad4c Make timestamp interpolation work with mpeg2 field pictures. Cleaner/simpler solutions are welcome. diff -r 99823c80a93d -r 9f4f88218b78 avcodec.h --- a/avcodec.h Tue Feb 19 22:50:28 2008 +0000 +++ b/avcodec.h Wed Feb 20 03:20:06 2008 +0000 @@ -2788,6 +2788,7 @@ /* 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 -r 99823c80a93d -r 9f4f88218b78 mpegvideo_parser.c --- a/mpegvideo_parser.c Tue Feb 19 22:50:28 2008 +0000 +++ b/mpegvideo_parser.c Wed Feb 20 03:20:06 2008 +0000 @@ -36,6 +36,7 @@ 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 @@ /* 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; }