forward = (pad == active_sinkpad);
switch (GST_EVENT_TYPE (event)) {
+ case GST_EVENT_STREAM_START:{
+ guint group_id;
+
+ if (!gst_event_parse_group_id (event, &group_id))
+ sel->have_group_id = FALSE;
+ break;
+ }
case GST_EVENT_FLUSH_START:
/* Unblock the pad if it's waiting */
selpad->flushing = TRUE;
gst_event_set_seqnum (e, GST_SELECTOR_PAD_CAST (sinkpad)->segment_seqnum);
gst_pad_push_event (sel->srcpad, e);
+ } else if (GST_EVENT_TYPE (*event) == GST_EVENT_STREAM_START
+ && !sel->have_group_id) {
+ GstEvent *tmp =
+ gst_pad_get_sticky_event (sel->srcpad, GST_EVENT_STREAM_START, 0);
+
+ /* Only push stream-start once if not all our streams have a stream-id */
+ if (!tmp) {
+ gst_pad_push_event (sel->srcpad, gst_event_ref (*event));
+ } else {
+ gst_event_unref (tmp);
+ }
} else {
gst_pad_push_event (sel->srcpad, gst_event_ref (*event));
}
sel->active_sinkpad = NULL;
sel->padcount = 0;
sel->sync_streams = DEFAULT_SYNC_STREAMS;
+ sel->have_group_id = TRUE;
g_mutex_init (&sel->lock);
g_cond_init (&sel->cond);
selpad->tags = NULL;
}
}
+ sel->have_group_id = TRUE;
GST_INPUT_SELECTOR_UNLOCK (sel);
}