d3d11convert: protect 'add-borders' with mutex

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4205>
This commit is contained in:
Aleksandr Slobodeniuk 2023-03-17 20:44:30 +01:00 committed by GStreamer Marge Bot
parent 1b926e0dcc
commit 4c9d4d30cb

View file

@ -1889,12 +1889,13 @@ static void
gst_d3d11_base_convert_set_add_border (GstD3D11BaseConvert * self, gst_d3d11_base_convert_set_add_border (GstD3D11BaseConvert * self,
gboolean add_border) gboolean add_border)
{ {
gboolean prev = self->add_borders; GstD3D11SRWLockGuard lk (&self->lock);
if (add_border != self->add_borders) {
self->add_borders = add_border; self->add_borders = add_border;
if (prev != self->add_borders)
gst_base_transform_reconfigure_src (GST_BASE_TRANSFORM_CAST (self)); gst_base_transform_reconfigure_src (GST_BASE_TRANSFORM_CAST (self));
} }
}
static void static void
gst_d3d11_base_convert_set_border_color (GstD3D11BaseConvert * self, gst_d3d11_base_convert_set_border_color (GstD3D11BaseConvert * self,