From d8ba6f1f3b0e3618acc7a5ef5623988c7c577912 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 17 Dec 2004 17:02:53 +0000 Subject: [PATCH] gst/playback/gstdecodebin.c: make sure the facotries are ordered the same every time even if they have the same rank ... 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 | 8 ++++++++ gst/playback/gstdecodebin.c | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 17d935d8ae..efc554c5f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-12-17 Benjamin Otte + + * 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 * configure.ac: look for musepack headers as musepack/*.h diff --git a/gst/playback/gstdecodebin.c b/gst/playback/gstdecodebin.c index 4b8f224a80..508cc16c26 100644 --- a/gst/playback/gstdecodebin.c +++ b/gst/playback/gstdecodebin.c @@ -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); }