diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2007-05-14 11:11:42 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2007-05-14 11:11:42 +0000 |
commit | 63b73eff7db09160daa2af06180fee4de65d200d (patch) | |
tree | 94b0781919feb3211914fe5824f99ec2af15c111 /gst | |
parent | fc2f6baf0de54a1b42a7c0d80e209cc55e3ba00c (diff) |
gst/rtsp/gstrtspsrc.c: Parse range correctly.
Original commit message from CVS:
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_parse_range):
Parse range correctly.
* gst/rtsp/rtspurl.c: (rtsp_url_get_request_uri):
The baseurl now always has a '/' at the start.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/rtsp/gstrtspsrc.c | 23 | ||||
-rw-r--r-- | gst/rtsp/rtspurl.c | 4 |
2 files changed, 21 insertions, 6 deletions
diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index 69a144a7..e1e2aea6 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -3228,13 +3228,28 @@ gst_rtspsrc_parse_range (GstRTSPSrc * src, const gchar * range) RTSPTimeRange *therange; if (rtsp_range_parse (range, &therange) == RTSP_OK) { + gint64 seconds; + GST_DEBUG_OBJECT (src, "range: '%s', min %f - max %f ", GST_STR_NULL (range), therange->min.seconds, therange->max.seconds); - gst_segment_set_duration (&src->segment, GST_FORMAT_TIME, - therange->max.seconds * GST_SECOND); - gst_segment_set_last_stop (&src->segment, GST_FORMAT_TIME, - therange->min.seconds * GST_SECOND); + if (therange->min.type == RTSP_TIME_NOW) + seconds = 0; + else if (therange->min.type == RTSP_TIME_END) + seconds = 0; + else + seconds = therange->min.seconds * GST_SECOND; + + gst_segment_set_last_stop (&src->segment, GST_FORMAT_TIME, seconds); + + if (therange->max.type == RTSP_TIME_NOW) + seconds = -1; + else if (therange->max.type == RTSP_TIME_END) + seconds = -1; + else + seconds = therange->max.seconds * GST_SECOND; + + gst_segment_set_duration (&src->segment, GST_FORMAT_TIME, seconds); } } diff --git a/gst/rtsp/rtspurl.c b/gst/rtsp/rtspurl.c index a1955e08..5d8caf1c 100644 --- a/gst/rtsp/rtspurl.c +++ b/gst/rtsp/rtspurl.c @@ -200,10 +200,10 @@ rtsp_url_get_request_uri (RTSPUrl * url) g_return_val_if_fail (url != NULL, NULL); if (url->port != 0) { - uri = g_strdup_printf ("rtsp://%s:%u/%s%s%s", url->host, url->port, + uri = g_strdup_printf ("rtsp://%s:%u%s%s%s", url->host, url->port, url->abspath, url->query ? "?" : "", url->query ? url->query : ""); } else { - uri = g_strdup_printf ("rtsp://%s/%s%s%s", url->host, url->abspath, + uri = g_strdup_printf ("rtsp://%s%s%s%s", url->host, url->abspath, url->query ? "?" : "", url->query ? url->query : ""); } |