d3d12encoder: Fix buffer pool leak

Add missing buffer pool release

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6628>
This commit is contained in:
Seungha Yang 2024-04-13 23:53:00 +09:00 committed by GStreamer Marge Bot
parent d00d8fff6b
commit e597dcdf0d

View file

@ -68,6 +68,9 @@ struct EncoderSessionData
~EncoderSessionData ()
{
if (upload_pool)
gst_buffer_pool_set_active (upload_pool, FALSE);
gst_clear_object (&upload_pool);
gst_clear_object (&encoder_pool);
gst_queue_array_free (output_queue);
}
@ -460,11 +463,13 @@ gst_d3d12_encoder_create_upload_pool (GstD3D12Encoder * self)
if (!gst_buffer_pool_set_config (pool, config)) {
GST_ERROR_OBJECT (self, "Set config failed");
gst_object_unref (pool);
return nullptr;
}
if (!gst_buffer_pool_set_active (pool, TRUE)) {
GST_ERROR_OBJECT (self, "Set active failed");
gst_object_unref (pool);
return nullptr;
}