concat: Make QoS forward MT-safe

In the same way it's done for other event forwarding.
This commit is contained in:
Edward Hervey 2017-11-09 17:38:19 +01:00 committed by Edward Hervey
parent 4670036691
commit 08ad748ced

View file

@ -715,16 +715,28 @@ gst_concat_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
GstClockTimeDiff diff; GstClockTimeDiff diff;
GstClockTime timestamp; GstClockTime timestamp;
gdouble proportion; gdouble proportion;
GstPad *sinkpad = NULL;
gst_event_parse_qos (event, &type, &proportion, &diff, &timestamp); g_mutex_lock (&self->lock);
gst_event_unref (event); if ((sinkpad = self->current_sinkpad))
gst_object_ref (sinkpad);
g_mutex_unlock (&self->lock);
if (timestamp != GST_CLOCK_TIME_NONE if (sinkpad) {
&& timestamp > self->current_start_offset) { gst_event_parse_qos (event, &type, &proportion, &diff, &timestamp);
timestamp -= self->current_start_offset; gst_event_unref (event);
event = gst_event_new_qos (type, proportion, diff, timestamp);
ret = gst_pad_push_event (self->current_sinkpad, event); if (timestamp != GST_CLOCK_TIME_NONE
&& timestamp > self->current_start_offset) {
timestamp -= self->current_start_offset;
event = gst_event_new_qos (type, proportion, diff, timestamp);
ret = gst_pad_push_event (self->current_sinkpad, event);
} else {
ret = FALSE;
}
gst_object_unref (sinkpad);
} else { } else {
gst_event_unref (event);
ret = FALSE; ret = FALSE;
} }
break; break;