va: pool: use gst_object_replace() for allocator

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1529>
This commit is contained in:
Víctor Manuel Jáquez Leal 2020-08-20 13:46:12 +02:00
parent f6a623d565
commit f306b1e0fe

View file

@ -106,10 +106,8 @@ gst_va_pool_set_config (GstBufferPool * pool, GstStructure * config)
GST_LOG_OBJECT (vpool, "%dx%d - %u | caps %" GST_PTR_FORMAT, width, height, GST_LOG_OBJECT (vpool, "%dx%d - %u | caps %" GST_PTR_FORMAT, width, height,
size, caps); size, caps);
if (vpool->allocator) gst_object_replace ((GstObject **) & vpool->allocator,
gst_object_unref (vpool->allocator); GST_OBJECT (allocator));
if ((vpool->allocator = allocator))
gst_object_ref (allocator);
/* enable metadata based on config of the pool */ /* enable metadata based on config of the pool */
vpool->add_videometa = gst_buffer_pool_config_has_option (config, vpool->add_videometa = gst_buffer_pool_config_has_option (config,