[Bug 696818] New: rtsprange: use gst_util_gdouble_to_guint64 in get_seconds

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Thu Mar 28 15:12:39 PDT 2013


https://bugzilla.gnome.org/show_bug.cgi?id=696818
  GStreamer | gst-plugins-base | git

           Summary: rtsprange: use gst_util_gdouble_to_guint64 in
                    get_seconds
    Classification: Platform
           Product: GStreamer
           Version: git
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-plugins-base
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: davidsf at axis.com
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


Created an attachment (id=240088)
 View: https://bugzilla.gnome.org/attachment.cgi?id=240088
 Review: https://bugzilla.gnome.org/review?bug=696818&attachment=240088

Use gst_util_gdouble_to_guint64 in get_seconds

On our 32-bit machines, we get the following unit test error in the libs/rtsp
suite (gst-plugins-base):

gst-plugins-base/tests/check/libs/rtsp.c:525:F:general:test_rtsp_range_convert:0:
'str' (clock=20001010T120023Z-20320518T152245.119999885Z) is not equal to
'"clock=20001010T120023Z-20320518T152245.12Z"'
(clock=20001010T120023Z-20320518T152245.12Z)
FAIL: libs/rtsp

The error comes in the part of test_rtsp_range_convert with ranges that end in
the year 2032, where we have large 64-bit numbers in the calculations. It
turned out that the difference between actual and expected numbers occurs in
the function get_seconds in gstrtsprange.c, where t->seconds * GST_SECOND is
returned. That gdouble value is implicitly cast to a guint64 (GstClockTime)
when returning from the function. On our 32-bit machines, the gdouble value
4177495365120000000.000000 becomes 4177495365119999885 in the cast.

With the attached patch, which uses gst_util_gdouble_to_guint64 for the
conversion, the test passes.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- 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