diff options
Diffstat (limited to 'libavcodec/mpeg12dec.c')
-rw-r--r-- | libavcodec/mpeg12dec.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index 6c4cbccc59..ebde68a4dd 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -1343,7 +1343,10 @@ static int mpeg1_decode_picture(AVCodecContext *avctx, const uint8_t *buf, s->mpeg_f_code[1][1] = f_code; } s->current_picture.f->pict_type = s->pict_type; - s->current_picture.f->key_frame = s->pict_type == AV_PICTURE_TYPE_I; + if (s->pict_type == AV_PICTURE_TYPE_I) + s->current_picture.f->flags |= AV_FRAME_FLAG_KEY; + else + s->current_picture.f->flags &= ~AV_FRAME_FLAG_KEY; if (avctx->debug & FF_DEBUG_PICT_INFO) av_log(avctx, AV_LOG_DEBUG, @@ -1525,7 +1528,10 @@ static int mpeg_decode_picture_coding_extension(Mpeg1Context *s1) } else s->pict_type = AV_PICTURE_TYPE_B; s->current_picture.f->pict_type = s->pict_type; - s->current_picture.f->key_frame = s->pict_type == AV_PICTURE_TYPE_I; + if (s->pict_type == AV_PICTURE_TYPE_I) + s->current_picture.f->flags |= AV_FRAME_FLAG_KEY; + else + s->current_picture.f->flags &= ~AV_FRAME_FLAG_KEY; } s->intra_dc_precision = get_bits(&s->gb, 2); @@ -3046,7 +3052,7 @@ static int ipu_decode_frame(AVCodecContext *avctx, AVFrame *frame, return AVERROR_INVALIDDATA; frame->pict_type = AV_PICTURE_TYPE_I; - frame->key_frame = 1; + frame->flags |= AV_FRAME_FLAG_KEY; *got_frame = 1; return avpkt->size; |