Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 548b6a53 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

Force play state when loading a file

parent e5106e3d
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!79Database update
...@@ -103,12 +103,17 @@ lmpv_load_file(mpv_handle *ctx, const char *file) ...@@ -103,12 +103,17 @@ lmpv_load_file(mpv_handle *ctx, const char *file)
{ {
RETURN_UNLESS(ctx, "Missing mpv ctx", 1); RETURN_UNLESS(ctx, "Missing mpv ctx", 1);
RETURN_IF(access(file, R_OK), "Failed to read file", 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; 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)); LOG_ERROR_SCT("WINDOW", "Failed to add '%s': %s", file, mpv_error_string(status));
return 1; 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; return 0;
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter