From 608a9dc177512300ba95ac0ec5c44dac03418894 Mon Sep 17 00:00:00 2001 From: Damian Hobson-Garcia Date: Thu, 30 May 2019 11:13:07 +0900 Subject: [PATCH] v4l2bufferpool: return TRUE when buffer pool orphaning succeeds When trying to orphan a buffer pool, successfully return and unref the pool when the pool is either successfully stopped or orphaned. Indicate failure and leave the pool untouched otherwise. --- sys/v4l2/gstv4l2bufferpool.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c index 282a02e..d7fa9fa 100644 --- a/sys/v4l2/gstv4l2bufferpool.c +++ b/sys/v4l2/gstv4l2bufferpool.c @@ -1003,11 +1003,16 @@ gst_v4l2_buffer_pool_orphan (GstBufferPool ** bpool) */ ret = gst_v4l2_buffer_pool_stop (*bpool); if (!ret) - gst_v4l2_allocator_orphan (pool->vallocator); + ret = gst_v4l2_allocator_orphan (pool->vallocator); + + if (!ret) + goto orphan_failed; pool->orphaned = TRUE; gst_object_unref (*bpool); *bpool = NULL; + +orphan_failed: return ret; } -- 2.7.4