summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2012-11-16 15:38:29 +0100
committerWim Taymans <wim.taymans@collabora.co.uk>2012-11-16 15:43:30 +0100
commit24fca05822a589f041b9327df9712004991565a7 (patch)
tree2bf9edf08806ecadf0c50008f0059871b6aafe3c
parentf3b0d2aa9bba6d965f6e97dba991b676e26162af (diff)
rtspsrc: handle segment event
Make a segment event when we send a new range header to a client (first PLAY request or after a seek). Send the segment event in interleaved mode. Clean the segment event on cleanup Fixes https://bugzilla.gnome.org/show_bug.cgi?id=688382
-rw-r--r--gst/rtsp/gstrtspsrc.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c
index bf8876912..d9a0e7be7 100644
--- a/gst/rtsp/gstrtspsrc.c
+++ b/gst/rtsp/gstrtspsrc.c
@@ -1233,6 +1233,10 @@ gst_rtspsrc_cleanup (GstRTSPSrc * src)
gst_sdp_message_free (src->sdp);
src->sdp = NULL;
}
+ if (src->start_segment) {
+ gst_event_unref (src->start_segment);
+ src->start_segment = NULL;
+ }
}
#define PARSE_INT(p, del, res) \
@@ -1910,11 +1914,6 @@ gst_rtspsrc_perform_seek (GstRTSPSrc * src, GstEvent * event)
GST_DEBUG_OBJECT (src, "Creating newsegment from %" G_GINT64_FORMAT
" to %" G_GINT64_FORMAT, src->segment.position, stop);
- /* store the newsegment event so it can be sent from the streaming thread. */
- if (src->start_segment)
- gst_event_unref (src->start_segment);
- src->start_segment = gst_event_new_segment (&src->segment);
-
/* mark discont */
GST_DEBUG_OBJECT (src, "mark DISCONT, we did a seek to another position");
for (walk = src->streams; walk; walk = g_list_next (walk)) {
@@ -3563,6 +3562,7 @@ gst_rtspsrc_loop_interleaved (GstRTSPSrc * src)
GstFlowReturn ret = GST_FLOW_OK;
GstBuffer *buf;
gboolean is_rtcp, have_data;
+ GstEvent *event;
/* here we are only interested in data messages */
have_data = FALSE;
@@ -3693,6 +3693,10 @@ gst_rtspsrc_loop_interleaved (GstRTSPSrc * src)
gst_rtspsrc_activate_streams (src);
src->need_activate = FALSE;
}
+ if ((event = src->start_segment) != NULL) {
+ src->start_segment = NULL;
+ gst_rtspsrc_push_event (src, event);
+ }
if (src->base_time == -1) {
/* Take current running_time. This timestamp will be put on
@@ -6180,6 +6184,11 @@ gst_rtspsrc_play (GstRTSPSrc * src, GstSegment * segment, gboolean async)
gst_rtsp_message_add_header (&request, GST_RTSP_HDR_RANGE, hval);
g_free (hval);
+
+ /* store the newsegment event so it can be sent from the streaming thread. */
+ if (src->start_segment)
+ gst_event_unref (src->start_segment);
+ src->start_segment = gst_event_new_segment (&src->segment);
}
if (segment->rate != 1.0) {