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 621161 - autoplug-sort default callback is run last - overwrite user supplied callback result
autoplug-sort default callback is run last - overwrite user supplied callback...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.28
Other Linux
: Normal normal
: 0.10.30
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-06-10 00:17 UTC by Alban Browaeys
Modified: 2010-06-14 09:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
accumulator for autoplug-sort (1.06 KB, patch)
2010-06-10 00:17 UTC, Alban Browaeys
none Details | Review

Description Alban Browaeys 2010-06-10 00:17:26 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.
Comment 1 Sebastian Dröge (slomo) 2010-06-10 06:29:50 UTC
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?
Comment 2 Benjamin Otte (Company) 2010-06-10 08:32:14 UTC
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
Comment 3 Wim Taymans 2010-06-14 09:10:51 UTC
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.
Comment 4 Wim Taymans 2010-06-14 09:20:51 UTC
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