[banshee/gst#] gst#: Only handle state-changed messages from the playbin.



commit 20e6f124246fb3d0b5f314e250ee7f91ccb4523f
Author: Christopher James Halse Rogers <chrishr src gnome org>
Date:   Sun May 15 00:28:00 2011 +0200

    gst#: Only handle state-changed messages from the playbin.
    
    OnBusMessage gets state-changed messages from everything in
    the playbin, but we're only interested in the overall state
    of the bin.  Only process messages from the playbin to cut
    out all the superfluous state changes.

 .../Banshee.GStreamerSharp/PlayerEngine.cs         |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/PlayerEngine.cs b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/PlayerEngine.cs
index 75b8e3d..feadc8f 100644
--- a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/PlayerEngine.cs
+++ b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/PlayerEngine.cs
@@ -103,9 +103,11 @@ namespace Banshee.GStreamerSharp
                     break;
 
                 case MessageType.StateChanged:
-                    State old_state, new_state, pending_state;
-                    msg.ParseStateChanged (out old_state, out new_state, out pending_state);
-                    HandleStateChange (old_state, new_state, pending_state);
+                    if (msg.Src == playbin) {
+                        State old_state, new_state, pending_state;
+                        msg.ParseStateChanged (out old_state, out new_state, out pending_state);
+                        HandleStateChange (old_state, new_state, pending_state);
+                    }
                     break;
 
                 case MessageType.Buffering:



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