diff options
Diffstat (limited to 'gst/gstbufferpool.c')
-rw-r--r-- | gst/gstbufferpool.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/gst/gstbufferpool.c b/gst/gstbufferpool.c index 7020345..d7a09d1 100644 --- a/gst/gstbufferpool.c +++ b/gst/gstbufferpool.c @@ -130,8 +130,7 @@ static GstFlowReturn default_alloc_buffer (GstBufferPool * pool, GstBuffer ** buffer, GstBufferPoolAcquireParams * params); static GstFlowReturn default_acquire_buffer (GstBufferPool * pool, GstBuffer ** buffer, GstBufferPoolAcquireParams * params); -static void default_reset_buffer (GstBufferPool * pool, GstBuffer * buffer, - GstBufferPoolAcquireParams * params); +static void default_reset_buffer (GstBufferPool * pool, GstBuffer * buffer); static void default_free_buffer (GstBufferPool * pool, GstBuffer * buffer); static void default_release_buffer (GstBufferPool * pool, GstBuffer * buffer); @@ -243,6 +242,7 @@ mark_meta_pooled (GstBuffer * buffer, GstMeta ** meta, gpointer user_data) GST_DEBUG_OBJECT (pool, "marking meta %p as POOLED in buffer %p", *meta, buffer); GST_META_FLAG_SET (*meta, GST_META_FLAG_POOLED); + GST_META_FLAG_SET (*meta, GST_META_FLAG_LOCKED); return TRUE; } @@ -988,14 +988,15 @@ dec_outstanding (GstBufferPool * pool) static gboolean remove_meta_unpooled (GstBuffer * buffer, GstMeta ** meta, gpointer user_data) { - if (!GST_META_FLAG_IS_SET (*meta, GST_META_FLAG_POOLED)) + if (!GST_META_FLAG_IS_SET (*meta, GST_META_FLAG_POOLED)) { + GST_META_FLAG_UNSET (*meta, GST_META_FLAG_LOCKED); *meta = NULL; + } return TRUE; } static void -default_reset_buffer (GstBufferPool * pool, GstBuffer * buffer, - GstBufferPoolAcquireParams * params) +default_reset_buffer (GstBufferPool * pool, GstBuffer * buffer) { GST_BUFFER_FLAGS (buffer) = 0; @@ -1048,9 +1049,6 @@ gst_buffer_pool_acquire_buffer (GstBufferPool * pool, GstBuffer ** buffer, /* all buffers from the pool point to the pool and have the refcount of the * pool incremented */ (*buffer)->pool = gst_object_ref (pool); - /* now reset the buffer when needed */ - if (G_LIKELY (pclass->reset_buffer)) - pclass->reset_buffer (pool, *buffer, params); } else { dec_outstanding (pool); } @@ -1093,6 +1091,10 @@ gst_buffer_pool_release_buffer (GstBufferPool * pool, GstBuffer * buffer) pclass = GST_BUFFER_POOL_GET_CLASS (pool); + /* reset the buffer when needed */ + if (G_LIKELY (pclass->reset_buffer)) + pclass->reset_buffer (pool, buffer); + if (G_LIKELY (pclass->release_buffer)) pclass->release_buffer (pool, buffer); |