g_malloc0 (sizeof (GstFluPSStream *) * (GST_FLUPS_DEMUX_MAX_STREAMS));
demux->scr_adjust = GSTTIME_TO_MPEGTIME (SCR_MUNGE);
+
+ demux->have_group_id = FALSE;
+ demux->group_id = G_MAXUINT;
}
static void
gst_event_replace (p_ev, NULL);
demux->scr_adjust = GSTTIME_TO_MPEGTIME (SCR_MUNGE);
+ demux->have_group_id = FALSE;
+ demux->group_id = G_MAXUINT;
}
static GstFluPSStream *
GstFluPSDemuxClass *klass = GST_FLUPS_DEMUX_GET_CLASS (demux);
GstCaps *caps;
GstClockTime threshold = SEGMENT_THRESHOLD;
+ GstEvent *event;
gchar *stream_id;
name = NULL;
stream_id =
gst_pad_create_stream_id_printf (stream->pad, GST_ELEMENT_CAST (demux),
"%02x", id);
- gst_pad_push_event (stream->pad, gst_event_new_stream_start (stream_id));
+
+ event = gst_pad_get_sticky_event (demux->sinkpad, GST_EVENT_STREAM_START, 0);
+ if (event) {
+ if (gst_event_parse_group_id (event, &demux->group_id))
+ demux->have_group_id = TRUE;
+ else
+ demux->have_group_id = FALSE;
+ gst_event_unref (event);
+ } else if (!demux->have_group_id) {
+ demux->have_group_id = TRUE;
+ demux->group_id = gst_util_group_id_next ();
+ }
+ event = gst_event_new_stream_start (stream_id);
+ if (demux->have_group_id)
+ gst_event_set_group_id (event, demux->group_id);
+
+ gst_pad_push_event (stream->pad, event);
g_free (stream_id);
gst_pad_set_caps (stream->pad, caps);