[Bug 755353] rtsprange: gst_rtsp_range_get_times() returns the wrong value for ntp ranges

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Sun May 6 10:46:57 UTC 2018


https://bugzilla.gnome.org/show_bug.cgi?id=755353

--- Comment #3 from Linus Svensson <linus.svensson at axis.com> ---
I tried to solve it like this:

+++ b/gst-libs/gst/rtsp/gstrtsprange.c
@@ -488,8 +488,8 @@ get_seconds (const GstRTSPTime * t)
      * errors.
      * This only works for "small" numbers, because num is limited to 32-bit
      */
-    gst_util_double_to_fraction (t->seconds, &num, &denom);
-    return gst_util_uint64_scale_int (GST_SECOND, num, denom);
+    gst_util_double_to_fraction (t->seconds - (GstClockTime)t->seconds, &num,
&denom);
+    return (GstClockTime)t->seconds * GST_SECOND + gst_util_uint64_scale_int
(GST_SECOND, num, denom);
   } else {
     return gst_util_gdouble_to_guint64 (t->seconds * GST_SECOND);
   }

But, then I got
libs/rtsp.c:283:F:general:test_rtsp_range_npt:0: 'max' (78300009999999) is not
equal to '78300010000000' (78300010000000)

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list