From: Nicolas Dufresne Date: Fri, 23 May 2014 19:56:02 +0000 (-0400) Subject: v4l2allocator: Add debug assert to detect calls in the wrong state X-Git-Tag: 1.3.3~87 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2cb6b9775c1c6a724bf7b7052e68b8513bd2c95c;p=platform%2Fupstream%2Fgst-plugins-good.git v4l2allocator: Add debug assert to detect calls in the wrong state --- diff --git a/sys/v4l2/gstv4l2allocator.c b/sys/v4l2/gstv4l2allocator.c index cc27ed7..bb819c9 100644 --- a/sys/v4l2/gstv4l2allocator.c +++ b/sys/v4l2/gstv4l2allocator.c @@ -1221,6 +1221,8 @@ gst_v4l2_allocator_qbuf (GstV4l2Allocator * allocator, gboolean ret = TRUE; gint i; + g_return_val_if_fail (g_atomic_int_get (&allocator->active), FALSE); + /* Buffer already queued */ if (IS_QUEUED (group->buffer)) return TRUE; @@ -1272,6 +1274,8 @@ gst_v4l2_allocator_dqbuf (GstV4l2Allocator * allocator) GstV4l2MemoryGroup *group = NULL; + g_return_val_if_fail (g_atomic_int_get (&allocator->active), FALSE); + buffer.type = allocator->type; buffer.memory = allocator->memory;