[Bug 785471] [API]: gst_audio_channel_mixer_new_with_matrix

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Tue Sep 19 22:56:19 UTC 2017


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

--- Comment #14 from Mathieu Duponchelle <mduponchelle1 at gmail.com> ---
> @@ +942,3 @@
> +    for (j = 0; j < mix->out_channels; j++) {
> +      if ((i == j && mix->matrix[i][j] != 1.0) ||
> +          (i != j && mix->matrix[i][j] != 0.0)) {
> 
> Comparing floats is not a good idea.

Yep very true, the issue here is even more pronounced as I'm not even comparing
to 1.0f or 0.0f, must have worked by chance when I tested. I'd still like to
determine whether a given user-defined matrix is passthrough or not accurately.

I gave a look at
https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/,
but while it seems comparing floats to known numbers is possible it's a lot of
complication for not much benefit, an alternative would be to expect an integer
matrix, but that's maybe not a very nice API.

I'll think more about it tomorrow :)

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