GNOME Bugzilla – Bug 621161
autoplug-sort default callback is run last - overwrite user supplied callback result
Last modified: 2010-06-14 09:20:51 UTC
Created attachment 163254 [details] [review] accumulator for autoplug-sort the default callback for autoplug-sort is run last . Thus the user supplied callback has no effect. Attached us an accumulator implementation to resolve this issue.
Wouldn't it be sufficient to just change the flags of the autoplug-sort signal from G_SIGNAL_RUN_LAST to G_SIGNAL_RUN_FIRST?
It should also be sufficient to use g_signal_connect_after() in applications instead of g_signal_connect(). See the invocation order in the description at http://library.gnome.org/devel/gobject/stable/gobject-Signals.html
We don't really want to run both the object handler and the user handler (one of them would produce unused results). What we want is to stop emission as soon as one handler returns a result. I'll update the patch.
Patch was ok (similar to the how the other signals were handled but I'm not entirely sure that those are optimal (ie, they could be run with the RUN_CLEANUP flag so that _after signals are also executed..) commit 2cb7cfab19bfa6b5937582612a1fb58b220335a5 Author: Prahal <prahal at yahoo.com> Date: Mon Jun 14 11:16:45 2010 +0200 decodebin2: use accumulator for autoplug-sort Use an accumulator for the autoplug-sort signal so that we can stop the emission when a signal handler produced a valid result. This avoids the object handler to overwrite the results from user signals. Fixes #621161