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

Unified · Split

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

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