1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/h264_parser: heuristically detect non marked keyframes

Fixes Ticket3083

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-10-26 15:46:43 +02:00
parent 41efb8d9a7
commit e0b2bdd37a

View File

@ -309,6 +309,9 @@ static inline int parse_nal_units(AVCodecParserContext *s,
h->sps = *h->sps_buffers[h->pps.sps_id]; h->sps = *h->sps_buffers[h->pps.sps_id];
h->frame_num = get_bits(&h->gb, h->sps.log2_max_frame_num); h->frame_num = get_bits(&h->gb, h->sps.log2_max_frame_num);
if(h->sps.ref_frame_count <= 1 && h->pps.ref_count[0] <= 1 && s->pict_type == AV_PICTURE_TYPE_I)
s->key_frame = 1;
avctx->profile = ff_h264_get_profile(&h->sps); avctx->profile = ff_h264_get_profile(&h->sps);
avctx->level = h->sps.level_idc; avctx->level = h->sps.level_idc;