aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author杨亚磊 via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>2023-09-14 13:22:13 +0000
committerNicolas George <george@nsup.org>2023-09-28 09:25:02 +0200
commitee8d2ece7b408d0c82908f65b5c38c6c1e5d2def (patch)
tree1f130d65089500da13916e2d20553c979672bd93
parentb643af4acb471c3cb09b02afcc511498c9674347 (diff)
downloadffmpeg-ee8d2ece7b408d0c82908f65b5c38c6c1e5d2def.tar.gz
lavfi/framequeue: remove redundant logic code
In this logical branch, fq->queued and fq->allocated must be equal. Deleting this code will make it easier to understand the logic (copy the data before tail to the newly requested space) Signed-off-by: yangyalei <yangyalei@xiaomi.com>
-rw-r--r--libavfilter/framequeue.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libavfilter/framequeue.c b/libavfilter/framequeue.c
index 383c195b85..ace0dad689 100644
--- a/libavfilter/framequeue.c
+++ b/libavfilter/framequeue.c
@@ -79,9 +79,8 @@ int ff_framequeue_add(FFFrameQueue *fq, AVFrame *frame)
FFFrameBucket *nq = av_realloc_array(fq->queue, na, sizeof(*nq));
if (!nq)
return AVERROR(ENOMEM);
- if (fq->tail + fq->queued > fq->allocated)
- memmove(nq + fq->allocated, nq,
- (fq->tail + fq->queued - fq->allocated) * sizeof(*nq));
+ if (fq->tail)
+ memmove(nq + fq->allocated, nq, fq->tail * sizeof(*nq));
fq->queue = nq;
fq->allocated = na;
}