History

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)

杨亚磊 via ffmpeg-devel committed 3 years ago

Commit ee8d2ec1 parent b643af41 file · +2 −3Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/framequeue.c+2−3
@@ -79,9 +79,8 @@ int ff_framequeue_add(FFFrameQueue *fq, AVFrame *frame) · 78 unmodified lines
7979 FFFrameBucket *nq = av_realloc_array(fq->queue, na, sizeof(*nq));
8080 if (!nq)
8181 return AVERROR(ENOMEM);
82− if (fq->tail + fq->queued > fq->allocated)
83− memmove(nq + fq->allocated, nq,
84− (fq->tail + fq->queued - fq->allocated) * sizeof(*nq));
82+ if (fq->tail)
83+ memmove(nq + fq->allocated, nq, fq->tail * sizeof(*nq));
8584 fq->queue = nq;
8685 fq->allocated = na;
8786 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t