summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJan Schmidt <thaytan@noraisin.net>2009-03-13 15:43:52 +0000
committerJan Schmidt <thaytan@noraisin.net>2009-03-13 15:43:52 +0000
commita32581abeea9264bba014f5e03063ee60f9c4bdb (patch)
tree5dc2a90137a1737d5ac273658da171c11ad0643d /sys
parent608d13d4620262bb7e3f9a985b81b608da99c32e (diff)
v4l2src: Prepend to lists and reverse them at the end.
Gratuitous micro-optimisation - prepend to lists and reverse them, rather than appending to them each time.
Diffstat (limited to 'sys')
-rw-r--r--sys/v4l2/v4l2_calls.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/v4l2/v4l2_calls.c b/sys/v4l2/v4l2_calls.c
index b1875a88..8f1a6c65 100644
--- a/sys/v4l2/v4l2_calls.c
+++ b/sys/v4l2/v4l2_calls.c
@@ -181,8 +181,9 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
}
v4l2object->channels =
- g_list_append (v4l2object->channels, (gpointer) channel);
+ g_list_prepend (v4l2object->channels, (gpointer) channel);
}
+ v4l2object->channels = g_list_reverse (v4l2object->channels);
GST_DEBUG_OBJECT (e, " norms");
/* norms... */
@@ -221,8 +222,9 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
standard.frameperiod.denominator, standard.frameperiod.numerator);
v4l2norm->index = standard.id;
- v4l2object->norms = g_list_append (v4l2object->norms, (gpointer) norm);
+ v4l2object->norms = g_list_prepend (v4l2object->norms, (gpointer) norm);
}
+ v4l2object->norms = g_list_reverse (v4l2object->norms);
GST_DEBUG_OBJECT (e, " controls+menus");
/* and lastly, controls+menus (if appropriate) */
@@ -364,8 +366,10 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
break;
}
- v4l2object->colors = g_list_append (v4l2object->colors, (gpointer) channel);
+ v4l2object->colors =
+ g_list_prepend (v4l2object->colors, (gpointer) channel);
}
+ v4l2object->colors = g_list_reverse (v4l2object->colors);
GST_DEBUG_OBJECT (e, "done");
return TRUE;