From d2025102e6f93ad0ee6b9075d9843e311b8384fb Mon Sep 17 00:00:00 2001 From: Erica Z Date: Sun, 20 Oct 2024 13:35:11 +0200 Subject: [PATCH] warn on failed seek --- src/playbin.vala | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/playbin.vala b/src/playbin.vala index 941ddb2..4a836f7 100644 --- a/src/playbin.vala +++ b/src/playbin.vala @@ -182,8 +182,12 @@ public class Playbin : GLib.Object { } public void seek (double position) { - this.position = position; - assert (this.mpv.command ({"seek", position.to_string (), "absolute"}) >= 0); + var rc = this.mpv.command ({"seek", position.to_string (), "absolute"}); + if (rc < 0) { + warning (@"could not seek to $position: $rc"); + } else { + this.position = position; + } } // manually changes which track in the play queue to play