From 89121c18e5d924e5c0ddef9c3ce7047de06245da Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 3 Jun 2011 12:40:56 +0200 Subject: [PATCH] bufferpool: make the default behaviour to wait The most common case is to not specify any flags when doing the allocation. Make the allocation from a pool with a maximum amount of buffers block by default for this reason. --- gst/gstbufferpool.c | 2 +- gst/gstbufferpool.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gst/gstbufferpool.c b/gst/gstbufferpool.c index 58f2a4f..f804309 100644 --- a/gst/gstbufferpool.c +++ b/gst/gstbufferpool.c @@ -578,7 +578,7 @@ default_acquire_buffer (GstBufferPool * pool, GstBuffer ** buffer, } /* check if we need to wait */ - if (params && !(params->flags & GST_BUFFER_POOL_FLAG_WAIT)) { + if (params && (params->flags & GST_BUFFER_POOL_FLAG_DONTWAIT)) { GST_LOG_OBJECT (pool, "no more buffers"); result = GST_FLOW_UNEXPECTED; break; diff --git a/gst/gstbufferpool.h b/gst/gstbufferpool.h index 50c5c63..7b5e8af 100644 --- a/gst/gstbufferpool.h +++ b/gst/gstbufferpool.h @@ -54,7 +54,7 @@ typedef struct _GstBufferPoolClass GstBufferPoolClass; * GstBufferPoolFlags: * @GST_BUFFER_POOL_FLAG_NONE: no flags * @GST_BUFFER_POOL_FLAG_KEY_UNIT: buffer is keyframe - * @GST_BUFFER_POOL_FLAG_WAIT: wait for buffer + * @GST_BUFFER_POOL_FLAG_DONTWAIT: don't wait for buffer * @GST_BUFFER_POOL_FLAG_DISCONT: buffer is discont * * Additional flags to control the allocation of a buffer @@ -62,7 +62,7 @@ typedef struct _GstBufferPoolClass GstBufferPoolClass; typedef enum { GST_BUFFER_POOL_FLAG_NONE = 0, GST_BUFFER_POOL_FLAG_KEY_UNIT = (1 << 0), - GST_BUFFER_POOL_FLAG_WAIT = (1 << 1), + GST_BUFFER_POOL_FLAG_DONTWAIT = (1 << 1), GST_BUFFER_POOL_FLAG_DISCONT = (1 << 2), GST_BUFFER_POOL_FLAG_LAST = (1 << 16), } GstBufferPoolFlags; -- 2.7.4