diff options
author | Ivan Schreter <schreter@gmx.net> | 2009-02-21 20:11:47 +0000 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at> | 2009-02-21 20:11:47 +0000 |
commit | 346db3ef7f82ea0ca8365e4a700c0113b2f3a86f (patch) | |
tree | ae6337ec7c89f22c4d3e7608c3da15ef09226aa8 /libavcodec/h264_parser.c | |
parent | f5007cc84499b005028064786c628ff4c8850f3c (diff) | |
download | ffmpeg-346db3ef7f82ea0ca8365e4a700c0113b2f3a86f.tar.gz |
Use context variable repeat_pict for frame duration computation and
document this new use.
Patch by Ivan Schreter, schreter gmx net
Originally committed as revision 17492 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264_parser.c')
-rw-r--r-- | libavcodec/h264_parser.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c index 149094a5b4..4d1d3f35e2 100644 --- a/libavcodec/h264_parser.c +++ b/libavcodec/h264_parser.c @@ -192,6 +192,35 @@ static inline int parse_nal_units(AVCodecParserContext *s, } } + if(h->sps.pic_struct_present_flag) { + switch (h->sei_pic_struct) { + case SEI_PIC_STRUCT_TOP_FIELD: + case SEI_PIC_STRUCT_BOTTOM_FIELD: + s->repeat_pict = -1; + break; + case SEI_PIC_STRUCT_FRAME: + case SEI_PIC_STRUCT_TOP_BOTTOM: + case SEI_PIC_STRUCT_BOTTOM_TOP: + s->repeat_pict = 0; + break; + case SEI_PIC_STRUCT_TOP_BOTTOM_TOP: + case SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM: + s->repeat_pict = 1; + break; + case SEI_PIC_STRUCT_FRAME_DOUBLING: + s->repeat_pict = 2; + break; + case SEI_PIC_STRUCT_FRAME_TRIPLING: + s->repeat_pict = 4; + break; + default: + s->repeat_pict = h->s.picture_structure == PICT_FRAME ? 0 : -1; + break; + } + } else { + s->repeat_pict = h->s.picture_structure == PICT_FRAME ? 0 : -1; + } + return 0; /* no need to evaluate the rest */ } buf += consumed; |