vaav1dec: Remove double caps unref.

There was a duplicated caps unref raising a warning.

Also it reorgs the sorrounding code for simplicity.

Fixes: #1196
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3587>
This commit is contained in:
Victor Manuel Jaquez Leal 2022-12-16 18:15:04 +01:00 committed by GStreamer Marge Bot
parent 068a5c1053
commit 171a626c6c

View file

@ -277,7 +277,7 @@ _create_internal_pool (GstVaAV1Dec * self, gint width, gint height)
gst_video_info_set_format (&info, self->preferred_format, width, height);
caps = gst_video_info_to_caps (&info);
if (caps == NULL) {
if (!caps) {
GST_WARNING_OBJECT (self, "Failed to create caps for internal pool");
return NULL;
}
@ -291,17 +291,15 @@ _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, &params);
gst_clear_caps (&caps);
gst_object_unref (allocator);
if (!pool) {
GST_WARNING_OBJECT (self, "Failed to create internal pool");
gst_object_unref (allocator);
return NULL;
}
gst_object_unref (allocator);
gst_caps_unref (caps);
gst_buffer_pool_set_active (pool, TRUE);
return pool;