mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-16 11:15:31 +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
ae12041f0c
commit
97eab82ddf
1 changed files with 12 additions and 2 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);
|
||||||
|
|
Loading…
Reference in a new issue