Commit 63b73eff authored by Wim Taymans's avatar Wim Taymans
Browse files

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.
parent fc2f6baf
2007-05-14 Wim Taymans <wim@fluendo.com>
* 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.
2007-05-14 Wim Taymans <wim@fluendo.com> 2007-05-14 Wim Taymans <wim@fluendo.com>
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_configure_caps), * gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_configure_caps),
......
...@@ -3228,13 +3228,28 @@ gst_rtspsrc_parse_range (GstRTSPSrc * src, const gchar * range) ...@@ -3228,13 +3228,28 @@ gst_rtspsrc_parse_range (GstRTSPSrc * src, const gchar * range)
RTSPTimeRange *therange; RTSPTimeRange *therange;
if (rtsp_range_parse (range, &therange) == RTSP_OK) { if (rtsp_range_parse (range, &therange) == RTSP_OK) {
gint64 seconds;
GST_DEBUG_OBJECT (src, "range: '%s', min %f - max %f ", GST_DEBUG_OBJECT (src, "range: '%s', min %f - max %f ",
GST_STR_NULL (range), therange->min.seconds, therange->max.seconds); GST_STR_NULL (range), therange->min.seconds, therange->max.seconds);
gst_segment_set_duration (&src->segment, GST_FORMAT_TIME, if (therange->min.type == RTSP_TIME_NOW)
therange->max.seconds * GST_SECOND); seconds = 0;
gst_segment_set_last_stop (&src->segment, GST_FORMAT_TIME, else if (therange->min.type == RTSP_TIME_END)
therange->min.seconds * GST_SECOND); 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);
} }
} }
......
...@@ -200,10 +200,10 @@ rtsp_url_get_request_uri (RTSPUrl * url) ...@@ -200,10 +200,10 @@ rtsp_url_get_request_uri (RTSPUrl * url)
g_return_val_if_fail (url != NULL, NULL); g_return_val_if_fail (url != NULL, NULL);
if (url->port != 0) { 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 : ""); url->abspath, url->query ? "?" : "", url->query ? url->query : "");
} else { } 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 : ""); url->query ? "?" : "", url->query ? url->query : "");
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment