diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-10-16 12:38:55 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-10-16 12:39:02 +0200 |
commit | 91248f081f343cde894a9c60624b6f4dc4581c94 (patch) | |
tree | a60c5ee84c0ae56eb907e55c415cdc6630cbdf49 | |
parent | 83bfcc3ce2554bd12d5eb790836530d3430bd908 (diff) | |
parent | b81dbd6cb7522bea96d78a52f8a4c25a47b820c9 (diff) | |
download | ffmpeg-91248f081f343cde894a9c60624b6f4dc4581c94.tar.gz |
Merge commit 'b81dbd6cb7522bea96d78a52f8a4c25a47b820c9'
* commit 'b81dbd6cb7522bea96d78a52f8a4c25a47b820c9':
h264_parser: Fix POC parsing for the case where MMCO_RESET is absent.
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/h264_parser.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c index a16366a781..978cc5f39e 100644 --- a/libavcodec/h264_parser.c +++ b/libavcodec/h264_parser.c @@ -180,8 +180,8 @@ static inline int parse_nal_units(AVCodecParserContext *s, case NAL_SLICE: case NAL_IDR_SLICE: // Do not walk the whole buffer just to decode slice header - if (src_length > 20) - src_length = 20; + if (src_length > 60) + src_length = 60; break; } ptr = ff_h264_decode_nal(h, buf, &dst_length, &consumed, src_length); @@ -267,8 +267,18 @@ static inline int parse_nal_units(AVCodecParserContext *s, h->delta_poc[1] = get_se_golomb(&h->gb); } + /* Decode POC of this picture. */ + field_poc[0] = field_poc[1] = INT_MAX; ff_init_poc(h, field_poc, &s->output_picture_number); + /* Set up the prev_ values for decoding POC of the next picture. */ + h->prev_frame_num = h->frame_num; + h->prev_frame_num_offset = h->frame_num_offset; + if (h->nal_ref_idc != 0) { + h->prev_poc_msb = h->poc_msb; + h->prev_poc_lsb = h->poc_lsb; + } + if (h->sps.pic_struct_present_flag) { switch (h->sei_pic_struct) { case SEI_PIC_STRUCT_TOP_FIELD: |