[gst-cvs] gst-plugins-good: rtspsrc: sanity checks on range info

Mark Nauwelaerts mnauw at kemper.freedesktop.org
Mon May 4 08:02:11 PDT 2009


Module: gst-plugins-good
Branch: master
Commit: 20c7be5741bfd39e2d2cbe647522b99bd339e101
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=20c7be5741bfd39e2d2cbe647522b99bd339e101

Author: Mark Nauwelaerts <mark.nauwelaerts at collabora.co.uk>
Date:   Thu Apr 30 10:17:23 2009 +0200

rtspsrc: sanity checks on range info

A max range that overflows should not be trusted,
nor should a max range that equals the min range.
Fixes #580851.(a).

---

 gst/rtsp/gstrtspsrc.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c
index 7699faf..4d786de 100644
--- a/gst/rtsp/gstrtspsrc.c
+++ b/gst/rtsp/gstrtspsrc.c
@@ -4389,6 +4389,17 @@ gst_rtspsrc_parse_range (GstRTSPSrc * src, const gchar * range,
   GST_DEBUG_OBJECT (src, "range: max %" GST_TIME_FORMAT,
       GST_TIME_ARGS (seconds));
 
+  /* live (WMS) server might send overflowed large max as its idea of infinity,
+   * compensate to prevent problems later on */
+  if (seconds != -1 && seconds < 0) {
+    seconds = -1;
+    GST_DEBUG_OBJECT (src, "insane range, set to NONE");
+  }
+
+  /* live (WMS) might send min == max, which is not worth recording */
+  if (segment->duration == -1 && seconds == segment->start)
+    seconds = -1;
+
   /* don't change duration with unknown value, we might have a valid value
    * there that we want to keep. */
   if (seconds != -1)





More information about the Gstreamer-commits mailing list