ref pool before creating buffer that's using it

Original commit message from CVS:
ref pool before creating buffer that's using it
This commit is contained in:
Benjamin Otte 2003-05-17 00:42:57 +00:00
parent 8777f9a763
commit 75ec036895

View file

@ -250,12 +250,13 @@ gst_buffer_new_from_pool (GstBufferPool *pool,
g_return_val_if_fail (pool != NULL, NULL); g_return_val_if_fail (pool != NULL, NULL);
gst_data_ref (GST_DATA (pool));
buffer = pool->buffer_new (pool, offset, size, pool->user_data); buffer = pool->buffer_new (pool, offset, size, pool->user_data);
if (!buffer) if (!buffer)
return NULL; return NULL;
GST_BUFFER_BUFFERPOOL (buffer) = pool; GST_BUFFER_BUFFERPOOL (buffer) = pool;
gst_data_ref (GST_DATA (pool));
/* override the buffer refcount functions with those from the pool (if any) */ /* override the buffer refcount functions with those from the pool (if any) */
if (pool->buffer_free) if (pool->buffer_free)