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/scpr.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/scpr.c')
-rw-r--r-- | libavcodec/scpr.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/scpr.c b/libavcodec/scpr.c index 7630adb3e0..b096965de5 100644 --- a/libavcodec/scpr.c +++ b/libavcodec/scpr.c @@ -516,18 +516,18 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, s->version = 1; s->get_freq = get_freq0; s->decode = decode0; - frame->key_frame = 1; + frame->flags |= AV_FRAME_FLAG_KEY; ret = decompress_i(avctx, (uint32_t *)s->current_frame->data[0], s->current_frame->linesize[0] / 4); } else if (type == 18) { s->version = 2; s->get_freq = get_freq; s->decode = decode; - frame->key_frame = 1; + frame->flags |= AV_FRAME_FLAG_KEY; ret = decompress_i(avctx, (uint32_t *)s->current_frame->data[0], s->current_frame->linesize[0] / 4); } else if (type == 34) { - frame->key_frame = 1; + frame->flags |= AV_FRAME_FLAG_KEY; s->version = 3; ret = decompress_i3(avctx, (uint32_t *)s->current_frame->data[0], s->current_frame->linesize[0] / 4); @@ -538,7 +538,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, if (bytestream2_get_bytes_left(gb) < 3) return AVERROR_INVALIDDATA; - frame->key_frame = 1; + frame->flags |= AV_FRAME_FLAG_KEY; bytestream2_skip(gb, 1); if (avctx->bits_per_coded_sample == 16) { uint16_t value = bytestream2_get_le16(gb); @@ -557,7 +557,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, dst += s->current_frame->linesize[0] / 4; } } else if (type == 0 || type == 1) { - frame->key_frame = 0; + frame->flags &= ~AV_FRAME_FLAG_KEY; if (s->version == 1 || s->version == 2) ret = decompress_p(avctx, (uint32_t *)s->current_frame->data[0], @@ -612,7 +612,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, } } - frame->pict_type = frame->key_frame ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P; + frame->pict_type = (frame->flags & AV_FRAME_FLAG_KEY) ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P; FFSWAP(AVFrame *, s->current_frame, s->last_frame); |