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
54 54
55#define BUCKET(i) queue->queue[(queue->head + (i)) % FF_BUFQUEUE_SIZE]55#define BUCKET(i) queue->queue[(queue->head + (i)) % FF_BUFQUEUE_SIZE]
56 56
57/**
58 * Test if a buffer queue is full.
59 */
60static inline int ff_bufqueue_is_full(struct FFBufQueue *queue)
61{
62 return queue->available == FF_BUFQUEUE_SIZE;
63}
64
57/**65/**
58 * Add a buffer to the queue.66 * Add a buffer to the queue.
59 *67 *
@@ -63,7 +71,7 @@ struct FFBufQueue { · 3 unmodified lines
63static inline void ff_bufqueue_add(void *log, struct FFBufQueue *queue,71static inline void ff_bufqueue_add(void *log, struct FFBufQueue *queue,
64 AVFilterBufferRef *buf)72 AVFilterBufferRef *buf)
65{73{
66 if (queue->available == FF_BUFQUEUE_SIZE) {74 if (ff_bufqueue_is_full(queue)) {
67 av_log(log, AV_LOG_WARNING, "Buffer queue overflow, dropping.\n");75 av_log(log, AV_LOG_WARNING, "Buffer queue overflow, dropping.\n");
68 avfilter_unref_buffer(BUCKET(--queue->available));76 avfilter_unref_buffer(BUCKET(--queue->available));
69 }77 }

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