1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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>
This commit is contained in:
杨亚磊 via ffmpeg-devel 2023-09-14 13:22:13 +00:00 committed by Nicolas George
parent b643af4acb
commit ee8d2ece7b

View File

@ -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;
}