After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 697990 - pluginfeature: Fix the GstPluginFeature name comparison.
pluginfeature: Fix the GstPluginFeature name comparison.
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 1.1.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-04-14 11:53 UTC by sreerenj
Modified: 2013-04-15 10:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gstpluginfeature: Fix the GstPluginFeature name comparison. (1.47 KB, patch)
2013-04-14 11:53 UTC, sreerenj
committed Details | Review
decodebin: use ascending order for name based sorting of pluginfeatures. (1.00 KB, patch)
2013-04-15 09:54 UTC, sreerenj
committed Details | Review
playbin: use ascending order for name based sorting of pluginfeatures. (990 bytes, patch)
2013-04-15 09:55 UTC, sreerenj
committed Details | Review

Description sreerenj 2013-04-14 11:53:18 UTC
Created attachment 241491 [details] [review]
 gstpluginfeature: Fix the GstPluginFeature name comparison.

The comment description of gst_plugin_feature_rank_compare_func() says that it should return negative value if "the ranks are equal but the name of p1 comes before the name of p2". So the strcmp() arguments should be in the order (p1,p2) instead of (p2,p1).
Comment 1 Sebastian Dröge (slomo) 2013-04-15 07:25:27 UTC
commit 899bbf310b5fb63f3aad96fde9fce0308039a386
Author: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Date:   Sat Apr 13 19:43:10 2013 +0300

    pluginfeature: Fix the GstPluginFeature name comparison.
    
    The gst_plugin_feature_rank_compare_func() should return
    negative value, if the rank of both PluginFeatures are equal and
    the name of first PluginFeature comes before the second one.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=697990
Comment 2 sreerenj 2013-04-15 07:40:19 UTC
It seems that the decodebin and playbin using descending order for name based sorting if ranks are the same.

The comments are saying that , /* And if it's a both a parser we first sort by rank and then by factory name */

IMHO, it would be bit more clear if we change it to ascending order or change the comment description at least.

What do you think?
Comment 3 Sebastian Dröge (slomo) 2013-04-15 08:20:51 UTC
Yes, ascending order makes more sense
Comment 4 sreerenj 2013-04-15 08:46:50 UTC
Okay,,I will submit a patch later today..Thanks
Comment 5 sreerenj 2013-04-15 09:54:44 UTC
Created attachment 241552 [details] [review]
decodebin: use ascending order for name based sorting of pluginfeatures.

The _decode_bin_compare_factories_func() should return negative value if the rank of both PluginFeatures are equal and the name of first PluginFeature comes before the second one (== ascending order).
Comment 6 sreerenj 2013-04-15 09:55:43 UTC
Created attachment 241553 [details] [review]
playbin: use ascending order for name based sorting of pluginfeatures.

The compare_factories_func() should return negative value if the rank of both PluginFeatures are equal and the name of first PluginFeature comes before the second one (== ascending order).