Showing the changes to libavfilter/bufferqueue.h (1 of 1 file). Show all
Unified · Split
| @@ -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 | */ | ||
| 60 | static 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 | |||
| 63 | static inline void ff_bufqueue_add(void *log, struct FFBufQueue *queue, | 71 | static 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 | } |