diff options
author | James Almer <jamrial@gmail.com> | 2023-04-12 13:58:54 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2023-05-04 18:48:22 -0300 |
commit | dc7bd7c5a5ad5ea800dfb63cc5dd15670d065527 (patch) | |
tree | 91cd3a4ae8b34601f34ff98aa4beb1ac1b5b28c2 /libavcodec/mpeg12dec.c | |
parent | cc11191fda0471017b03c1434d6d8cb79f6914e5 (diff) | |
download | ffmpeg-dc7bd7c5a5ad5ea800dfb63cc5dd15670d065527.tar.gz |
avcodec: use the new AVFrame key_frame flag in all decoders and encoders
Signed-off-by: James Almer <jamrial@gmail.com>
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; |