[gst-devel] Bug in gst_caps_structure_fixate_field_nearest_int

David Schleef ds at schleef.org
Tue Apr 13 13:51:17 CEST 2004


On Tue, Apr 13, 2004 at 10:52:44AM -0400, Sebastien Cote wrote:
> Hi,
> 
> I've found a bug in
> gst_caps_structure_fixate_field_nearest_int() and
> gst_caps_structure_fixate_field_nearest_double() in
> GStreamer-0.8 but it is also present in CVS.
> 
> When looking for the best value, we have
> 
>         if (best_index == -1 || (ABS (target - x) <
> ABS (best - x))) {
>           best_index = i;
>           best = x;
>         }
> 
> ABS(best - x) is wrong, it should be ABS(target -
> best).  So these 2 functions almost never return the
> expected result.
> 
> Should I open a bug on this or is it better to use
> this mailing-list (or both)?

It's always better to file a bug.

For this bug, however, I just fixed it.  Thanks for noticing.



dave...





More information about the gstreamer-devel mailing list