mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
aggregator: More fixes around locking when accessing protected private fields
In some more places we were accessing GstAggregator->segment and GstAggregator->seqnum without holding the GST_OBJECT_LOCK https://bugzilla.gnome.org/show_bug.cgi?id=742684
This commit is contained in:
parent
1a07467d5f
commit
ccf329d527
2 changed files with 13 additions and 3 deletions
|
@ -494,9 +494,13 @@ gst_aggregator_push_eos (GstAggregator * self)
|
||||||
GstEvent *event;
|
GstEvent *event;
|
||||||
gst_aggregator_push_mandatory_events (self);
|
gst_aggregator_push_mandatory_events (self);
|
||||||
|
|
||||||
self->priv->send_eos = FALSE;
|
|
||||||
event = gst_event_new_eos ();
|
event = gst_event_new_eos ();
|
||||||
|
|
||||||
|
GST_OBJECT_LOCK (self);
|
||||||
|
self->priv->send_eos = FALSE;
|
||||||
gst_event_set_seqnum (event, self->priv->seqnum);
|
gst_event_set_seqnum (event, self->priv->seqnum);
|
||||||
|
GST_OBJECT_UNLOCK (self);
|
||||||
|
|
||||||
gst_pad_push_event (self->srcpad, event);
|
gst_pad_push_event (self->srcpad, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -883,7 +887,10 @@ gst_aggregator_default_sink_event (GstAggregator * self,
|
||||||
GST_OBJECT_LOCK (aggpad);
|
GST_OBJECT_LOCK (aggpad);
|
||||||
gst_event_copy_segment (event, &aggpad->segment);
|
gst_event_copy_segment (event, &aggpad->segment);
|
||||||
GST_OBJECT_UNLOCK (aggpad);
|
GST_OBJECT_UNLOCK (aggpad);
|
||||||
|
|
||||||
|
GST_OBJECT_LOCK (self);
|
||||||
self->priv->seqnum = gst_event_get_seqnum (event);
|
self->priv->seqnum = gst_event_get_seqnum (event);
|
||||||
|
GST_OBJECT_UNLOCK (self);
|
||||||
goto eat;
|
goto eat;
|
||||||
}
|
}
|
||||||
case GST_EVENT_STREAM_START:
|
case GST_EVENT_STREAM_START:
|
||||||
|
@ -1246,10 +1253,13 @@ gst_aggregator_send_event (GstElement * element, GstEvent * event)
|
||||||
|
|
||||||
gst_event_parse_seek (event, &rate, &fmt, &flags, &start_type,
|
gst_event_parse_seek (event, &rate, &fmt, &flags, &start_type,
|
||||||
&start, &stop_type, &stop);
|
&start, &stop_type, &stop);
|
||||||
|
|
||||||
|
GST_OBJECT_LOCK (self);
|
||||||
gst_segment_do_seek (&self->segment, rate, fmt, flags, start_type, start,
|
gst_segment_do_seek (&self->segment, rate, fmt, flags, start_type, start,
|
||||||
stop_type, stop, NULL);
|
stop_type, stop, NULL);
|
||||||
|
|
||||||
self->priv->seqnum = gst_event_get_seqnum (event);
|
self->priv->seqnum = gst_event_get_seqnum (event);
|
||||||
|
GST_OBJECT_UNLOCK (self);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (element, "Storing segment %" GST_PTR_FORMAT, event);
|
GST_DEBUG_OBJECT (element, "Storing segment %" GST_PTR_FORMAT, event);
|
||||||
}
|
}
|
||||||
GST_STATE_UNLOCK (element);
|
GST_STATE_UNLOCK (element);
|
||||||
|
|
|
@ -1615,8 +1615,8 @@ gst_videoaggregator_flush (GstAggregator * agg)
|
||||||
GstVideoAggregator *vagg = GST_VIDEO_AGGREGATOR (agg);
|
GstVideoAggregator *vagg = GST_VIDEO_AGGREGATOR (agg);
|
||||||
|
|
||||||
GST_INFO_OBJECT (agg, "Flushing");
|
GST_INFO_OBJECT (agg, "Flushing");
|
||||||
abs_rate = ABS (agg->segment.rate);
|
|
||||||
GST_OBJECT_LOCK (vagg);
|
GST_OBJECT_LOCK (vagg);
|
||||||
|
abs_rate = ABS (agg->segment.rate);
|
||||||
for (l = GST_ELEMENT (vagg)->sinkpads; l; l = l->next) {
|
for (l = GST_ELEMENT (vagg)->sinkpads; l; l = l->next) {
|
||||||
GstVideoAggregatorPad *p = l->data;
|
GstVideoAggregatorPad *p = l->data;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue