warn on failed seek

This commit is contained in:
Erica Z 2024-10-20 13:35:11 +02:00
parent 26449b9dcf
commit d2025102e6

View file

@ -182,8 +182,12 @@ public class Playbin : GLib.Object {
} }
public void seek (double position) { public void seek (double position) {
this.position = position; var rc = this.mpv.command ({"seek", position.to_string (), "absolute"});
assert (this.mpv.command ({"seek", position.to_string (), "absolute"}) >= 0); if (rc < 0) {
warning (@"could not seek to $position: $rc");
} else {
this.position = position;
}
} }
// manually changes which track in the play queue to play // manually changes which track in the play queue to play