From e1fa107fd1ac22f3f34c2bc5367a7055da784499 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 3 Jul 2024 13:24:23 +0200 Subject: [PATCH] lavc/ffv1dec: simplify slice index calculation --- libavcodec/ffv1dec.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index 5c515e97b6..7066146477 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -259,10 +259,7 @@ static int decode_slice(AVCodecContext *c, void *arg) int width, height, x, y, ret; const int ps = av_pix_fmt_desc_get(c->pix_fmt)->comp[0].step; AVFrame * const p = f->cur; - int si; - - for( si=0; fs != f->slice_context[si]; si ++) - ; + const int si = (FFV1Context**)arg - f->slice_context; if (f->fsrc && !(p->flags & AV_FRAME_FLAG_KEY) && f->last_picture.f) ff_progress_frame_await(&f->last_picture, si);