mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-26 00:58:12 +00:00
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:
parent
fc2f6baf0d
commit
63b73eff7d
3 changed files with 29 additions and 6 deletions
|
@ -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>
|
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)
|
||||||
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)
|
||||||
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 : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue