[rhythmbox] replaygain: use BLOCK_DOWNSTREAM probe rather than IDLE



commit 51b0878349980b125c0c7bd24b177d86201479b2
Author: Jonathan Matthew <jonathan d14n org>
Date:   Fri Aug 2 23:28:49 2013 +1000

    replaygain: use BLOCK_DOWNSTREAM probe rather than IDLE
    
    IDLE probes run way too much risk of recursive and simultaneous
    callbacks in multiple threads.  At the point we're probing, we
    know data is flowing, so BLOCK_DOWNSTREAM should work fine.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=700401

 plugins/replaygain/player.py |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/plugins/replaygain/player.py b/plugins/replaygain/player.py
index a1d3ceb..903e493 100644
--- a/plugins/replaygain/player.py
+++ b/plugins/replaygain/player.py
@@ -146,9 +146,8 @@ class ReplayGainPlayer(object):
                rgvolume.set_state(Gst.State.READY)
                rgvolume.set_state(Gst.State.PLAYING)
                #self.resetting_rgvolume = False
-               pad.remove_probe(info.id)
                self.set_rgvolume(rgvolume)
-               return Gst.PadProbeReturn.OK
+               return Gst.PadProbeReturn.REMOVE
 
        def playing_entry_changed(self, player, entry):
                if entry is None:
@@ -159,8 +158,8 @@ class ReplayGainPlayer(object):
 
                if self.got_replaygain is False:
                        print("blocking rgvolume to reset it")
-                       pad = self.rgvolume.get_static_pad("sink").get_peer()
-                       pad.add_probe(Gst.PadProbeType.IDLE, self.rgvolume_blocked, self.rgvolume)
+                       pad = self.rgvolume.get_static_pad("sink")
+                       pad.add_probe(Gst.PadProbeType.BLOCK_DOWNSTREAM, self.rgvolume_blocked, self.rgvolume)
                else:
                        print("no need to reset rgvolume")
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]