diff --git a/src/module/mpv.c b/src/module/mpv.c index 3f101b9c51be6406f9bad78df40378080753b13c..65311b8ffc50b000872dde091b6ac3ad168c053c 100644 --- a/src/module/mpv.c +++ b/src/module/mpv.c @@ -103,12 +103,17 @@ lmpv_load_file(mpv_handle *ctx, const char *file) { RETURN_UNLESS(ctx, "Missing mpv ctx", 1); RETURN_IF(access(file, R_OK), "Failed to read file", 1); - const char *cmd[] = {"loadfile", file, "replace", NULL}; + const char *cmd1[] = { "loadfile", file, "replace", NULL }; + const char *cmd2[] = { "set", "pause", "0", NULL }; int status; - if ((status = mpv_command_async(ctx, 0, cmd)) < 0) { + if ((status = mpv_command_async(ctx, 0, cmd1)) < 0) { LOG_ERROR_SCT("WINDOW", "Failed to add '%s': %s", file, mpv_error_string(status)); return 1; } + if ((status = mpv_command_async(ctx, 0, cmd2)) < 0) { + LOG_ERROR_SCT("WINDOW", "Failed to set state to play: %s", mpv_error_string(status)); + return 1; + } return 0; }