summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorEdward Hervey <edward@centricular.com>2017-11-09 17:38:19 +0100
committerEdward Hervey <bilboed@bilboed.com>2017-11-09 17:41:51 +0100
commit08ad748cedf36fc4884c56afcb43922fdadf78f5 (patch)
treefab3576febdd702042296cc7218ec14b02c3617a /plugins
parent4670036691a329cc1b42696ea6797a8b56ed2a91 (diff)
concat: Make QoS forward MT-safe
In the same way it's done for other event forwarding.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/elements/gstconcat.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/plugins/elements/gstconcat.c b/plugins/elements/gstconcat.c
index 4cc134d99..1493b3824 100644
--- a/plugins/elements/gstconcat.c
+++ b/plugins/elements/gstconcat.c
@@ -715,16 +715,28 @@ gst_concat_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
GstClockTimeDiff diff;
GstClockTime timestamp;
gdouble proportion;
+ GstPad *sinkpad = NULL;
- gst_event_parse_qos (event, &type, &proportion, &diff, &timestamp);
- gst_event_unref (event);
+ g_mutex_lock (&self->lock);
+ if ((sinkpad = self->current_sinkpad))
+ gst_object_ref (sinkpad);
+ g_mutex_unlock (&self->lock);
+
+ if (sinkpad) {
+ gst_event_parse_qos (event, &type, &proportion, &diff, &timestamp);
+ gst_event_unref (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);
+ 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 {
+ gst_event_unref (event);
ret = FALSE;
}
break;