mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-03 16:09:39 +00:00
va: allocator: user gst_clear_object() for _buffer_surface_unref()
Event if this function is only used by gst_va_dmabuf_memories_setup(), it might get reused later by GstVaDmabufAllocator's functions. This change makes the function less fragile. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1626>
This commit is contained in:
parent
10b3250175
commit
d6f9cfc159
1 changed files with 2 additions and 1 deletions
|
@ -438,7 +438,7 @@ _buffer_surface_unref (gpointer data)
|
||||||
if (g_atomic_int_dec_and_test (&buf->ref_count)) {
|
if (g_atomic_int_dec_and_test (&buf->ref_count)) {
|
||||||
GST_LOG_OBJECT (buf->display, "Destroying surface %#x", buf->surface);
|
GST_LOG_OBJECT (buf->display, "Destroying surface %#x", buf->surface);
|
||||||
_destroy_surfaces (buf->display, &buf->surface, 1);
|
_destroy_surfaces (buf->display, &buf->surface, 1);
|
||||||
gst_object_unref (buf->display);
|
gst_clear_object (&buf->display);
|
||||||
g_slice_free (GstVaBufferSurface, buf);
|
g_slice_free (GstVaBufferSurface, buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -451,6 +451,7 @@ _create_buffer_surface (VASurfaceID surface, GstVideoFormat format,
|
||||||
|
|
||||||
g_atomic_int_set (&buf->ref_count, 0);
|
g_atomic_int_set (&buf->ref_count, 0);
|
||||||
buf->surface = surface;
|
buf->surface = surface;
|
||||||
|
buf->display = NULL;
|
||||||
gst_video_info_set_format (&buf->info, format, width, height);
|
gst_video_info_set_format (&buf->info, format, width, height);
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
|
|
Loading…
Reference in a new issue