mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
msdk: release resources if failing to create the buffer pool
Needn't check the pointers against NULL because the pointers are non-NULL
This commit is contained in:
parent
a301150002
commit
ba7f4de298
3 changed files with 10 additions and 6 deletions
|
@ -1112,11 +1112,14 @@ error_no_pool:
|
||||||
error_no_allocator:
|
error_no_allocator:
|
||||||
{
|
{
|
||||||
GST_INFO_OBJECT (thiz, "failed to create allocator");
|
GST_INFO_OBJECT (thiz, "failed to create allocator");
|
||||||
|
gst_object_unref (pool);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
error_pool_config:
|
error_pool_config:
|
||||||
{
|
{
|
||||||
GST_INFO_OBJECT (thiz, "failed to set config");
|
GST_INFO_OBJECT (thiz, "failed to set config");
|
||||||
|
gst_object_unref (pool);
|
||||||
|
gst_object_unref (allocator);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -952,11 +952,14 @@ error_no_pool:
|
||||||
error_no_allocator:
|
error_no_allocator:
|
||||||
{
|
{
|
||||||
GST_INFO_OBJECT (thiz, "failed to create allocator");
|
GST_INFO_OBJECT (thiz, "failed to create allocator");
|
||||||
|
gst_object_unref (pool);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
error_pool_config:
|
error_pool_config:
|
||||||
{
|
{
|
||||||
GST_INFO_OBJECT (thiz, "failed to set config");
|
GST_INFO_OBJECT (thiz, "failed to set config");
|
||||||
|
gst_object_unref (pool);
|
||||||
|
gst_object_unref (allocator);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -304,22 +304,20 @@ error_no_pool:
|
||||||
error_no_video_info:
|
error_no_video_info:
|
||||||
{
|
{
|
||||||
GST_INFO_OBJECT (thiz, "Failed to get Video info from caps");
|
GST_INFO_OBJECT (thiz, "Failed to get Video info from caps");
|
||||||
|
gst_object_unref (pool);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
error_no_allocator:
|
error_no_allocator:
|
||||||
{
|
{
|
||||||
GST_INFO_OBJECT (thiz, "Failed to create allocator");
|
GST_INFO_OBJECT (thiz, "Failed to create allocator");
|
||||||
if (pool)
|
gst_object_unref (pool);
|
||||||
gst_object_unref (pool);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
error_pool_config:
|
error_pool_config:
|
||||||
{
|
{
|
||||||
GST_INFO_OBJECT (thiz, "Failed to set config");
|
GST_INFO_OBJECT (thiz, "Failed to set config");
|
||||||
if (pool)
|
gst_object_unref (pool);
|
||||||
gst_object_unref (pool);
|
gst_object_unref (allocator);
|
||||||
if (allocator)
|
|
||||||
gst_object_unref (allocator);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue