[gnome-music/wip/mschraal/gapless-v3: 23/25] gstplayer: Do not seek to exact end



commit 26dd53185c0608d2443b6fad581641082c20b103
Author: Marinus Schraal <mschraal gnome org>
Date:   Sat May 4 13:55:05 2019 +0200

    gstplayer: Do not seek to exact end
    
    Seeking to the exact end of a song in combination with gapless playback
    triggers a stream error.
    Make sure to never seek to the exact endpoint of a stream.

 gnomemusic/gstplayer.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/gstplayer.py b/gnomemusic/gstplayer.py
index f53cc142..adc66783 100644
--- a/gnomemusic/gstplayer.py
+++ b/gnomemusic/gstplayer.py
@@ -303,9 +303,12 @@ class GstPlayer(GObject.GObject):
 
         :param float seconds: Position in seconds to seek
         """
+        if seconds > 0:
+            seconds = (seconds * Gst.SECOND) - 1
+
         self._player.seek_simple(
             Gst.Format.TIME, Gst.SeekFlags.FLUSH | Gst.SeekFlags.KEY_UNIT,
-            seconds * Gst.SECOND)
+            seconds)
 
     @log
     def _start_plugin_installation(


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