rtspsrc: Make sure to send SEGMENT events on all pads

This commit is contained in:
Sebastian Dröge 2015-03-05 09:35:32 +01:00
parent e05378ec16
commit 788074733c

View file

@ -4564,12 +4564,15 @@ gst_rtspsrc_handle_data (GstRTSPSrc * src, GstRTSPMessage * message)
gchar *uri; gchar *uri;
GList *streams; GList *streams;
guint group_id = gst_util_group_id_next (); guint group_id = gst_util_group_id_next ();
GstSegment segment;
/* generate an SHA256 sum of the URI */ /* generate an SHA256 sum of the URI */
cs = g_checksum_new (G_CHECKSUM_SHA256); cs = g_checksum_new (G_CHECKSUM_SHA256);
uri = src->conninfo.location; uri = src->conninfo.location;
g_checksum_update (cs, (const guchar *) uri, strlen (uri)); g_checksum_update (cs, (const guchar *) uri, strlen (uri));
gst_segment_init (&segment, GST_FORMAT_TIME);
for (streams = src->streams; streams; streams = g_list_next (streams)) { for (streams = src->streams; streams; streams = g_list_next (streams)) {
GstRTSPStream *ostream = (GstRTSPStream *) streams->data; GstRTSPStream *ostream = (GstRTSPStream *) streams->data;
GstCaps *caps; GstCaps *caps;
@ -4585,6 +4588,13 @@ gst_rtspsrc_handle_data (GstRTSPSrc * src, GstRTSPMessage * message)
if ((caps = stream_get_caps_for_pt (ostream, ostream->default_pt))) { if ((caps = stream_get_caps_for_pt (ostream, ostream->default_pt))) {
gst_rtspsrc_stream_push_event (src, ostream, gst_event_new_caps (caps)); gst_rtspsrc_stream_push_event (src, ostream, gst_event_new_caps (caps));
} }
/* Push a SEGMENT event if we don't have one pending, if we have one
* pending we will just send that one a few lines below to all pads
*/
if (!src->start_segment)
gst_rtspsrc_stream_push_event (src, ostream,
gst_event_new_segment (&segment));
} }
g_checksum_free (cs); g_checksum_free (cs);