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.
This commit is contained in:
Damian Hobson-Garcia 2019-05-30 11:13:07 +09:00 committed by Nicolas Dufresne
parent f3970565f0
commit 1b9a0f1c2d

View file

@ -995,11 +995,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;
}