mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-28 14:01:27 +00:00
lavfi/bufferqueue: add ff_bufqueue_is_full().
This commit is contained in:
parent
dd87d4a318
commit
6560625f0a
@ -54,6 +54,14 @@ struct FFBufQueue {
|
||||
|
||||
#define BUCKET(i) queue->queue[(queue->head + (i)) % FF_BUFQUEUE_SIZE]
|
||||
|
||||
/**
|
||||
* Test if a buffer queue is full.
|
||||
*/
|
||||
static inline int ff_bufqueue_is_full(struct FFBufQueue *queue)
|
||||
{
|
||||
return queue->available == FF_BUFQUEUE_SIZE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a buffer to the queue.
|
||||
*
|
||||
@ -63,7 +71,7 @@ struct FFBufQueue {
|
||||
static inline void ff_bufqueue_add(void *log, struct FFBufQueue *queue,
|
||||
AVFilterBufferRef *buf)
|
||||
{
|
||||
if (queue->available == FF_BUFQUEUE_SIZE) {
|
||||
if (ff_bufqueue_is_full(queue)) {
|
||||
av_log(log, AV_LOG_WARNING, "Buffer queue overflow, dropping.\n");
|
||||
avfilter_unref_buffer(BUCKET(--queue->available));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user