[rygel] playbin: Notify duration change only once



commit 93b7b91db3d19bcbd2d679089a7c0eccdc7d3a7f
Author: Jens Georg <mail jensge org>
Date:   Sat Mar 24 10:41:55 2012 +0100

    playbin: Notify duration change only once

 src/plugins/playbin/rygel-playbin-player.vala |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/plugins/playbin/rygel-playbin-player.vala b/src/plugins/playbin/rygel-playbin-player.vala
index d7b5d4b..c37c94b 100644
--- a/src/plugins/playbin/rygel-playbin-player.vala
+++ b/src/plugins/playbin/rygel-playbin-player.vala
@@ -185,11 +185,13 @@ public class Rygel.Playbin.Player : GLib.Object, Rygel.MediaPlayer {
                               Message message) {
         switch (message.type) {
         case MessageType.STATE_CHANGED:
-            State old_state, new_state;
+            if (message.src == this.playbin) {
+                State old_state, new_state;
 
-            message.parse_state_changed (out old_state, out new_state, null);
-            if (old_state == State.READY && new_state == State.PAUSED) {
-                this.notify_property ("duration");
+                message.parse_state_changed (out old_state, out new_state, null);
+                if (old_state == State.READY && new_state == State.PAUSED) {
+                    this.notify_property ("duration");
+                }
             }
             break;
         case MessageType.EOS:



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