gst/playback/gstdecodebin.c: make sure the facotries are ordered the same every time...
authorBenjamin Otte <otte@gnome.org>
Fri, 17 Dec 2004 17:02:53 +0000 (17:02 +0000)
committerBenjamin Otte <otte@gnome.org>
Fri, 17 Dec 2004 17:02:53 +0000 (17:02 +0000)
Original commit message from CVS:
* gst/playback/gstdecodebin.c: (compare_ranks):
make sure the facotries are ordered the same every time even if they
have the same rank by using the name
* gst/playback/gstdecodebin.c: (find_compatibles):
make sure we don't add factories to the list twice

ChangeLog
gst/playback/gstdecodebin.c

index 17d935d..efc554c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-12-17  Benjamin Otte  <in7y118@public.uni-hamburg.de>
+
+       * gst/playback/gstdecodebin.c: (compare_ranks):
+         make sure the facotries are ordered the same every time even if they
+         have the same rank by using the name
+       * gst/playback/gstdecodebin.c: (find_compatibles):
+         make sure we don't add factories to the list twice
+
 2004-12-16  David Schleef  <ds@schleef.org>
 
        * configure.ac: look for musepack headers as musepack/*.h
index 4b8f224..508cc16 100644 (file)
@@ -259,7 +259,13 @@ gst_decode_bin_factory_filter (GstPluginFeature * feature,
 static gint
 compare_ranks (GstPluginFeature * f1, GstPluginFeature * f2)
 {
-  return gst_plugin_feature_get_rank (f2) - gst_plugin_feature_get_rank (f1);
+  gint diff;
+
+  diff = gst_plugin_feature_get_rank (f2) - gst_plugin_feature_get_rank (f1);
+  if (diff != 0)
+    return diff;
+  return strcmp (gst_plugin_feature_get_name (f2),
+      gst_plugin_feature_get_name (f1));
 }
 
 static void
@@ -364,6 +370,8 @@ find_compatibles (GstDecodeBin * decode_bin, const GstCaps * caps)
         if (!gst_caps_is_empty (intersect)) {
           /* non empty intersection, we can use this element */
           to_try = g_list_append (to_try, factory);
+          gst_caps_free (intersect);
+          break;
         }
         gst_caps_free (intersect);
       }