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.
This commit is contained in:
Wim Taymans 2007-05-14 11:11:42 +00:00
parent fc2f6baf0d
commit 63b73eff7d
3 changed files with 29 additions and 6 deletions

View file

@ -1,3 +1,11 @@
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>
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_configure_caps),

View file

@ -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);
}
}

View file

@ -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 : "");
}