diff --git a/src/playbin.vala b/src/playbin.vala index 70a11cd..9fc9407 100644 --- a/src/playbin.vala +++ b/src/playbin.vala @@ -158,13 +158,22 @@ class Playbin : GLib.Object { public void pause () { assert (this.state != PlaybinState.STOPPED); this.state = PlaybinState.PAUSED; - assert (this.mpv.command ({"pause"}) >= 0); + GLib.debug ("setting state to paused"); + // TODO: abstract away this handling around mpv api a bit for auto debug printing + var ret = this.mpv.set_property_flag("pause", true); + if (ret != 0) { + GLib.debug ("failed to set state to paused (%d): %s\n", ret, ret.to_string()); + } } public void play () { assert (this.state != PlaybinState.STOPPED); this.state = PlaybinState.PLAYING; - assert (this.mpv.command ({"play"}) >= 0); + GLib.debug ("setting state to playing"); + var ret = this.mpv.set_property_flag("pause", false); + if (ret != 0) { + GLib.debug ("failed to set state to playing (%d): %s\n", ret, ret.to_string()); + } } public void next_track () {