From b9053c5ae84f639700d72b43e4307fd91a7de270 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 9 Nov 2009 17:49:51 +0100 Subject: [PATCH] playback: Avoid expensive API calls in tight loop. We know we're dealing with GstPluginFeature. --- gst/playback/gstfactorylists.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/gst/playback/gstfactorylists.c b/gst/playback/gstfactorylists.c index c9d313469a..085c1536df 100644 --- a/gst/playback/gstfactorylists.c +++ b/gst/playback/gstfactorylists.c @@ -31,20 +31,16 @@ static gint compare_ranks (GValue * v1, GValue * v2) { gint diff; - const gchar *rname1, *rname2; GstPluginFeature *f1, *f2; f1 = g_value_get_object (v1); f2 = g_value_get_object (v2); - diff = gst_plugin_feature_get_rank (f2) - gst_plugin_feature_get_rank (f1); + diff = f2->rank - f1->rank; if (diff != 0) return diff; - rname1 = gst_plugin_feature_get_name (f1); - rname2 = gst_plugin_feature_get_name (f2); - - diff = strcmp (rname2, rname1); + diff = strcmp (f1->name, f2->name); return diff; }