aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ffv1dec.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2023-04-12 13:58:54 -0300
committerJames Almer <jamrial@gmail.com>2023-05-04 18:48:22 -0300
commitdc7bd7c5a5ad5ea800dfb63cc5dd15670d065527 (patch)
tree91cd3a4ae8b34601f34ff98aa4beb1ac1b5b28c2 /libavcodec/ffv1dec.c
parentcc11191fda0471017b03c1434d6d8cb79f6914e5 (diff)
downloadffmpeg-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/ffv1dec.c')
-rw-r--r--libavcodec/ffv1dec.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index c49db83b5c..54cf075b8f 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -264,16 +264,16 @@ static int decode_slice(AVCodecContext *c, void *arg)
for( si=0; fs != f->slice_context[si]; si ++)
;
- if(f->fsrc && !p->key_frame)
+ if(f->fsrc && !(p->flags & AV_FRAME_FLAG_KEY))
ff_thread_await_progress(&f->last_picture, si, 0);
- if(f->fsrc && !p->key_frame) {
+ if(f->fsrc && !(p->flags & AV_FRAME_FLAG_KEY)) {
FFV1Context *fssrc = f->fsrc->slice_context[si];
FFV1Context *fsdst = f->slice_context[si];
av_assert1(fsdst->plane_count == fssrc->plane_count);
av_assert1(fsdst == fs);
- if (!p->key_frame)
+ if (!(p->flags & AV_FRAME_FLAG_KEY))
fsdst->slice_damaged |= fssrc->slice_damaged;
for (i = 0; i < f->plane_count; i++) {
@@ -310,7 +310,7 @@ static int decode_slice(AVCodecContext *c, void *arg)
}
if ((ret = ff_ffv1_init_slice_state(f, fs)) < 0)
return ret;
- if (f->cur->key_frame || fs->slice_reset_contexts) {
+ if ((f->cur->flags & AV_FRAME_FLAG_KEY) || fs->slice_reset_contexts) {
ff_ffv1_clear_slice_state(f, fs);
} else if (fs->slice_damaged) {
return AVERROR_INVALIDDATA;
@@ -892,7 +892,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe,
p->pict_type = AV_PICTURE_TYPE_I; //FIXME I vs. P
if (get_rac(c, &keystate)) {
- p->key_frame = 1;
+ p->flags |= AV_FRAME_FLAG_KEY;
f->key_frame_ok = 0;
if ((ret = read_header(f)) < 0)
return ret;
@@ -903,7 +903,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe,
"Cannot decode non-keyframe without valid keyframe\n");
return AVERROR_INVALIDDATA;
}
- p->key_frame = 0;
+ p->flags &= ~AV_FRAME_FLAG_KEY;
}
if (f->ac != AC_GOLOMB_RICE) {
@@ -927,7 +927,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe,
if (avctx->debug & FF_DEBUG_PICT_INFO)
av_log(avctx, AV_LOG_DEBUG, "ver:%d keyframe:%d coder:%d ec:%d slices:%d bps:%d\n",
- f->version, p->key_frame, f->ac, f->ec, f->slice_count, f->avctx->bits_per_raw_sample);
+ f->version, !!(p->flags & AV_FRAME_FLAG_KEY), f->ac, f->ec, f->slice_count, f->avctx->bits_per_raw_sample);
ff_thread_finish_setup(avctx);