gst/gstcaps.c: Fix bug in fixating lists.

Original commit message from CVS:
* gst/gstcaps.c: (gst_caps_structure_fixate_field_nearest_int),
(gst_caps_structure_fixate_field_nearest_double):  Fix bug in
fixating lists.
This commit is contained in:
David Schleef 2004-04-13 20:50:53 +00:00
parent 4e3489c2e5
commit b3a5ebd27c
2 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2004-04-13 David Schleef <ds@schleef.org>
* gst/gstcaps.c: (gst_caps_structure_fixate_field_nearest_int),
(gst_caps_structure_fixate_field_nearest_double): Fix bug in
fixating lists.
2004-04-12 David Schleef <ds@schleef.org>
* gst/gstbuffer.c: (_gst_buffer_initialize), (gst_buffer_get_type),

View file

@ -1257,7 +1257,7 @@ gst_caps_structure_fixate_field_nearest_int (GstStructure * structure,
if (G_VALUE_TYPE (list_value) == G_TYPE_INT) {
int x = g_value_get_int (list_value);
if (best_index == -1 || (ABS (target - x) < ABS (best - x))) {
if (best_index == -1 || (ABS (target - x) < ABS (target - best))) {
best_index = i;
best = x;
}
@ -1320,7 +1320,7 @@ gst_caps_structure_fixate_field_nearest_double (GstStructure * structure,
if (G_VALUE_TYPE (list_value) == G_TYPE_DOUBLE) {
double x = g_value_get_double (list_value);
if (best_index == -1 || (ABS (target - x) < ABS (best - x))) {
if (best_index == -1 || (ABS (target - x) < ABS (target - best))) {
best_index = i;
best = x;
}