va: filter: destroy pipeline buffer after destroying filters

In 6ae24948 the pipeline buffer destroy were removing assuming it
wasn't required. Nonetheless, debugging the code it looks like a
buffer leak in iHD driver since the ID of the buffer kept increasing.

The difference now is that first the filter buffers are destroy first
and later the pipeline buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2023>
This commit is contained in:
Víctor Manuel Jáquez Leal 2021-02-17 18:30:10 +01:00 committed by GStreamer Merge Bot
parent 2e9a096282
commit b7988b4de8

View file

@ -906,7 +906,7 @@ _destroy_filters_unlocked (GstVaFilter * self)
gboolean ret = TRUE;
guint i;
GST_TRACE_OBJECT (self, "Destroy filter buffers");
GST_TRACE_OBJECT (self, "Destroying %u filter buffers", self->filters->len);
dpy = gst_va_display_get_va_dpy (self->display);
@ -1005,6 +1005,9 @@ _create_pipeline_buffer (GstVaFilter * self, VASurfaceID surface,
return FALSE;
}
GST_TRACE_OBJECT (self, "Created VABufferID %#x with %u filters", *buffer,
num_filters);
return TRUE;
}
@ -1099,6 +1102,14 @@ bail:
g_array_unref (self->filters);
_destroy_filters_unlocked (self);
}
gst_va_display_lock (self->display);
status = vaDestroyBuffer (dpy, buffer);
gst_va_display_unlock (self->display);
if (status != VA_STATUS_SUCCESS) {
GST_WARNING_OBJECT (self, "Failed to destroy pipeline buffer: %s",
vaErrorStr (status));
}
GST_OBJECT_UNLOCK (self);
return ret;