playbin: Emit LastChange when duration is known
authorJens Georg <mail@jensge.org>
Tue, 13 Mar 2012 12:03:32 +0000 (13:03 +0100)
committerJens Georg <mail@jensge.org>
Tue, 13 Mar 2012 12:03:35 +0000 (13:03 +0100)
src/plugins/playbin/rygel-playbin-player.vala

index 61e0ad6..d7b5d4b 100644 (file)
@@ -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");