diff --git a/src/module/mpv.c b/src/module/mpv.c index 746741094163972c729411d4e8cb2fb332fbd7b2..c9e9d2e633bf0c2483c101633a9c37eb1e4b2c7a 100644 --- a/src/module/mpv.c +++ b/src/module/mpv.c @@ -116,25 +116,6 @@ error: return NULL; } -int -lmpv_is_paused(mpv_handle *ctx, int *ret) -{ - int status; - - if (!ctx) { - fprintf(stderr, " ! lmpv_is_paused: failed due to missing mpv ctx\n"); - return 1; - } - - if ((status = mpv_get_property(ctx, "pause", MPV_FORMAT_FLAG, ret)) < 0) { - fprintf(stderr, "lmpv_is_paused: Failed to get pause property: %s\n", - mpv_error_string(status)); - return 1; - } - - return 0; -} - int lmpv_set_volume(mpv_handle *ctx, int vol) { @@ -149,7 +130,7 @@ lmpv_set_volume(mpv_handle *ctx, int vol) snprintf(str, 4, "%d", vol); const char *cmd[] = {"set", "ao-volume", str, NULL}; - if ((status = mpv_command(ctx, cmd)) < 0) { + if ((status = mpv_command_async(ctx, 0, cmd)) < 0) { fprintf(stderr, " ! lmpv_set_volume: Failed to execute command: %s\n", mpv_error_string(status)); return 1; @@ -173,7 +154,7 @@ lmpv_load_file(mpv_handle *ctx, const char *file) const char *cmd[] = {"loadfile", file, "replace", NULL}; int status; - if ((status = mpv_command(ctx, cmd)) < 0) { + if ((status = mpv_command_async(ctx, 0, cmd)) < 0) { fprintf(stderr, " ! lmpv_load_file: Failed to add '%s': %s\n", file, mpv_error_string(status)); return 1; @@ -192,7 +173,7 @@ lmpv_toggle_pause(mpv_handle *ctx) const char *cmd[] = {"cycle", "pause", "up", NULL}; int status; - if ((status = mpv_command(ctx, cmd)) < 0) { + if ((status = mpv_command_async(ctx, 0, cmd)) < 0) { fprintf(stderr, "lmpv_toggle_pause: Failed issue command: %s\n", mpv_error_string(status)); return 1;