History

lavfi/bufferqueue: add ff_bufqueue_is_full().

Nicolas George committed 13 years ago

Commit 65606251 parent dd87d4a1 file · +9 −1Browse files

Unified · Split

libavfilter/bufferqueue.h+9−1
@@ -54,6 +54,14 @@ struct FFBufQueue { · 53 unmodified lines
5454
5555 #define BUCKET(i) queue->queue[(queue->head + (i)) % FF_BUFQUEUE_SIZE]
5656
57+/**
58+ * Test if a buffer queue is full.
59+ */
60+static inline int ff_bufqueue_is_full(struct FFBufQueue *queue)
61+{
62+ return queue->available == FF_BUFQUEUE_SIZE;
63+}
64+
5765 /**
5866 * Add a buffer to the queue.
5967 *
@@ -63,7 +71,7 @@ struct FFBufQueue { · 3 unmodified lines
6371 static inline void ff_bufqueue_add(void *log, struct FFBufQueue *queue,
6472 AVFilterBufferRef *buf)
6573 {
66− if (queue->available == FF_BUFQUEUE_SIZE) {
74+ if (ff_bufqueue_is_full(queue)) {
6775 av_log(log, AV_LOG_WARNING, "Buffer queue overflow, dropping.\n");
6876 avfilter_unref_buffer(BUCKET(--queue->available));
6977 }

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