mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 02:01:12 +00:00
va: Fix the caps memory leak by gst_va_pool_new_with_config().
The gst_va_pool_new_with_config() will ref the caps, and so we need to unref after that. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3503>
This commit is contained in:
parent
c8a0d706ca
commit
765adf5325
2 changed files with 5 additions and 2 deletions
|
@ -312,10 +312,11 @@ _create_internal_pool (GstVaAV1Dec * self, gint width, gint height)
|
|||
pool = gst_va_pool_new_with_config (caps, GST_VIDEO_INFO_SIZE (&info),
|
||||
1, 0, VA_SURFACE_ATTRIB_USAGE_HINT_DECODER, GST_VA_FEATURE_AUTO,
|
||||
allocator, ¶ms);
|
||||
gst_clear_caps (&caps);
|
||||
|
||||
if (!pool) {
|
||||
GST_WARNING_OBJECT (self, "Failed to create internal pool");
|
||||
gst_object_unref (allocator);
|
||||
gst_clear_caps (&caps);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -197,7 +197,7 @@ _get_sinkpad_pool (GstVaBaseEnc * base)
|
|||
GstAllocationParams params = { 0, };
|
||||
guint size, usage_hint = 0;
|
||||
GArray *surface_formats = NULL;
|
||||
GstCaps *caps;
|
||||
GstCaps *caps = NULL;
|
||||
|
||||
if (base->priv->raw_pool)
|
||||
return base->priv->raw_pool;
|
||||
|
@ -217,6 +217,8 @@ _get_sinkpad_pool (GstVaBaseEnc * base)
|
|||
|
||||
base->priv->raw_pool = gst_va_pool_new_with_config (caps, size, 1, 0,
|
||||
usage_hint, GST_VA_FEATURE_AUTO, allocator, ¶ms);
|
||||
gst_clear_caps (&caps);
|
||||
|
||||
if (!base->priv->raw_pool) {
|
||||
gst_object_unref (allocator);
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in a new issue