[gstreamer-bugs] [Bug 607381] New: GST_FRAMES_TO_CLOCK_TIME() GST_CLOCK_TIME_TO_FRAMES() should round result

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Mon Jan 18 15:04:25 PST 2010


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

           Summary: GST_FRAMES_TO_CLOCK_TIME() GST_CLOCK_TIME_TO_FRAMES()
                    should round result
    Classification: Desktop
           Product: GStreamer
           Version: git
        OS/Version: All
            Status: UNCONFIRMED
          Severity: minor
          Priority: Normal
         Component: gst-plugins-base
        AssignedTo: gstreamer-bugs at lists.sourceforge.net
        ReportedBy: kcannon at ligo.caltech.edu
         QAContact: gstreamer-bugs at lists.sourceforge.net
      GNOME target: ---
     GNOME version: ---


The macros GST_FRAMES_TO_CLOCK_TIME() and GST_CLOCK_TIME_TO_FRAMES() use
gst_util_uint64_scale() to convert a sample offset to a clock time and vice
versa.  This function truncates its results.  gst_util_uint64_scale_round()
should be used instead to round the answer to the nearest integer result.  This
prevents a clock drift when sample indexes are converted to clock times and
back to sample indexes, etc., repeatedly when working with data streams whose
sample periods are not exactly an integer number of nanoseconds (e.g.,
power-of-2 sample rates like 16384 Hz).

For example, GST_CLOCK_TIME_TO_FRAMES(GST_FRAMES_TO_CLOCK_TIME(n,16384),16384)
returns n-1 for most n.

Changing these macros to the rounding versions does not break the unit tests
for the elements that use them already.

-- 
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