[rygel] playbin: Emit LastChange when duration is known



commit 41b7ac88d7fd2c32bf8e3895f44bb4f34623f71a
Author: Jens Georg <mail jensge org>
Date:   Tue Mar 13 13:03:32 2012 +0100

    playbin: Emit LastChange when duration is known

 src/plugins/playbin/rygel-playbin-player.vala |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/playbin/rygel-playbin-player.vala b/src/plugins/playbin/rygel-playbin-player.vala
index 61e0ad6..d7b5d4b 100644
--- a/src/plugins/playbin/rygel-playbin-player.vala
+++ b/src/plugins/playbin/rygel-playbin-player.vala
@@ -184,6 +184,14 @@ public class Rygel.Playbin.Player : GLib.Object, Rygel.MediaPlayer {
     private bool bus_handler (Gst.Bus bus,
                               Message message) {
         switch (message.type) {
+        case MessageType.STATE_CHANGED:
+            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");
+            }
+            break;
         case MessageType.EOS:
             if (!this.is_rendering_image ()) {
                 debug ("EOS");



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