From: Jens Georg Date: Thu, 22 Nov 2012 22:19:49 +0000 (+0100) Subject: renderer-gst: Check duration availability X-Git-Tag: RYGEL_0_17_2_W48~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ed1f9ea42c63905ebcea9d39c6f2147d0a4f1ff9;p=profile%2Fivi%2Frygel.git renderer-gst: Check duration availability --- diff --git a/src/librygel-renderer-gst/rygel-playbin-player.vala b/src/librygel-renderer-gst/rygel-playbin-player.vala index 9a6ad26..e7388fd 100644 --- a/src/librygel-renderer-gst/rygel-playbin-player.vala +++ b/src/librygel-renderer-gst/rygel-playbin-player.vala @@ -81,7 +81,6 @@ public class Rygel.Playbin.Player : GLib.Object, Rygel.MediaPlayer { "video/x-xvid", "video/x-ms-wmv" }; private static Player player; - bool duration_hint; private bool is_live; private bool foreign; @@ -327,7 +326,9 @@ public class Rygel.Playbin.Player : GLib.Object, Rygel.MediaPlayer { Message message) { switch (message.type) { case MessageType.DURATION_CHANGED: - this.duration_hint = true; + if (this.playbin.query_duration (Format.TIME, null)) { + this.notify_property ("duration"); + } break; case MessageType.STATE_CHANGED: if (message.src == this.playbin) { @@ -337,11 +338,6 @@ public class Rygel.Playbin.Player : GLib.Object, Rygel.MediaPlayer { out new_state, out pending); if (old_state == State.READY && new_state == State.PAUSED) { - if (this.duration_hint) { - this.notify_property ("duration"); - this.duration_hint = false; - } - if (this.uri_update_hint) { this.uri_update_hint = false; string uri = this.playbin.current_uri; @@ -461,7 +457,6 @@ public class Rygel.Playbin.Player : GLib.Object, Rygel.MediaPlayer { } private void setup_playbin () { - this.duration_hint = false; // Needed to get "Stop" events from the playbin. // We can do this because we have a bus watch this.is_live = false;