summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com>2020-11-09 17:58:09 +0100
committerJan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com>2020-11-09 17:58:09 +0100
commit0c293361a7247b9a754b4daba279eb96baf00f47 (patch)
treea884c7b5bc87ecba3438437b6ece4c3036156af6
parent56c949fb42735fd50a84c3cc20a41cdeb7adf22e (diff)
downloadgstreamer-plugins-base-0c293361a7247b9a754b4daba279eb96baf00f47.tar.gz
videoaggregator: Take object lock for writing vagg->info
Take `GST_OBJECT_LOCK` when writing `vagg->info`, so that reading in subclasses is protected against races, as documented in the struct. /*< public >*/ /* read-only, with OBJECT_LOCK */ GstVideoInfo info; Cherry-picked changes from b3fe2d3623722ebf9dfe5c3dc198764ce17cba38. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/926>
-rw-r--r--gst-libs/gst/video/gstvideoaggregator.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gst-libs/gst/video/gstvideoaggregator.c b/gst-libs/gst/video/gstvideoaggregator.c
index b334f40e0..bb0379bcf 100644
--- a/gst-libs/gst/video/gstvideoaggregator.c
+++ b/gst-libs/gst/video/gstvideoaggregator.c
@@ -1057,7 +1057,9 @@ gst_video_aggregator_default_negotiated_src_caps (GstAggregator * agg,
gst_video_aggregator_reset_qos (vagg);
}
+ GST_OBJECT_LOCK (vagg);
vagg->info = info;
+ GST_OBJECT_UNLOCK (vagg);
finfo = vagg->info.finfo;
@@ -1416,7 +1418,10 @@ gst_video_aggregator_reset (GstVideoAggregator * vagg)
GstAggregator *agg = GST_AGGREGATOR (vagg);
GList *l;
+ GST_OBJECT_LOCK (vagg);
gst_video_info_init (&vagg->info);
+ GST_OBJECT_UNLOCK (vagg);
+
vagg->priv->ts_offset = 0;
vagg->priv->nframes = 0;
vagg->priv->live = FALSE;