[gstreamer-bugs] [Bug 499181] audiorate inserting samples (due to rounding errors ?)

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Wed Oct 21 08:28:09 PDT 2009


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

Thiago Sousa Santos <thiagoss> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
                 CC|                            |thiagoss at embedded.ufcg.edu.
                   |                            |br
     Ever Confirmed|0                           |1

--- Comment #2 from Thiago Sousa Santos <thiagoss at embedded.ufcg.edu.br> 2009-10-21 12:11:18 UTC ---
In this pipeline audioconvert is inserting 1 (2 bytes) sample when it does the
following math to calculate the next_offset: 

/* Figure out the total accumulated segment time. */
  run_time = in_time + audiorate->src_segment.accum;

  /* calculate the buffer offset */
  in_offset = gst_util_uint64_scale_int (run_time, audiorate->rate,
GST_SECOND);
  in_offset_end = in_offset + in_samples;

In one of the cases I got from the logs I have:

10216780045(runtime) * 44100(rate) / 1000000000.0(GST_SECOND) = 450559.9999845,
and of course it uses 450559.

Should we be using gst_util_uint64_scale_round ?

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