[rygel/rygel-0-20] renderer-gst: Check seek target



commit 49dbc7ae86a865cbee24a58e5fe3a77bc76989da
Author: Jens Georg <jensg openismus com>
Date:   Mon Sep 30 11:25:17 2013 +0200

    renderer-gst: Check seek target
    
    The seek call on playbin doesn't fail when seeking beyond the end of the file
    and just switches to EOS.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=709077

 .../rygel-playbin-player.vala                      |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/librygel-renderer-gst/rygel-playbin-player.vala 
b/src/librygel-renderer-gst/rygel-playbin-player.vala
index bb59613..f7673f6 100644
--- a/src/librygel-renderer-gst/rygel-playbin-player.vala
+++ b/src/librygel-renderer-gst/rygel-playbin-player.vala
@@ -321,6 +321,12 @@ public class Rygel.Playbin.Player : GLib.Object, Rygel.MediaPlayer {
     }
 
     public bool seek (int64 time) {
+        // Playbin doesn't return false when seeking beyond the end of the
+        // file
+        if (time > this.duration) {
+            return false;
+        }
+
         return this.playbin.seek (1.0,
                                   Format.TIME,
                                   SeekFlags.FLUSH,


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