After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 567955 - [spectrum] Need compensation for rounding errors
[spectrum] Need compensation for rounding errors
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 0.10.14
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-01-16 09:51 UTC by Sebastian Dröge (slomo)
Modified: 2009-01-23 08:37 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sebastian Dröge (slomo) 2009-01-16 09:51:37 UTC
Hi,
we need some compensation for rounding errors in the spectrum element at several places:

a) The number of samples per interval is rounded down ( interval * GST_SECOND / rate ) which results in more spectrum messages over time than requested

b) The timestamps of the messages are calculated from the first buffer timestamp + n * interval. Because of a) this results in timestamps lacking behind the real stream time.
Comment 1 Sebastian Dröge (slomo) 2009-01-19 10:16:06 UTC
I've implemented this now by adding a counter for the accumulated error and adding an additional sample to every interval when it overflows (i.e. >= GST_SECOND).

2009-01-19  Sebastian Dröge  <sebastian.droege@collabora.co.uk>

	* gst/spectrum/gstspectrum.c: (gst_spectrum_reset_state),
	(gst_spectrum_transform_ip):
	* gst/spectrum/gstspectrum.h:
	Implement a simple compensation algorithm for rounding errors.
	This makes sure that a spectrum message is posted on the bus
	every interval nanoseconds. Fixes bug #567955.