summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--player/command.h1
-rw-r--r--player/playloop.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/player/command.h b/player/command.h
index c47ed40f1d..b45e616497 100644
--- a/player/command.h
+++ b/player/command.h
@@ -102,6 +102,7 @@ enum {
MP_EVENT_CHANGE_PLAYLIST,
MP_EVENT_CORE_IDLE,
MP_EVENT_DURATION_UPDATE,
+ MP_EVENT_INPUT_PROCESSED,
};
bool mp_hook_test_completion(struct MPContext *mpctx, char *type);
diff --git a/player/playloop.c b/player/playloop.c
index 6cff3c9108..87c8b6390c 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -110,13 +110,17 @@ void mp_core_unlock(struct MPContext *mpctx)
// Process any queued user input.
static void mp_process_input(struct MPContext *mpctx)
{
+ int processed = 0;
for (;;) {
mp_cmd_t *cmd = mp_input_read_cmd(mpctx->input);
if (!cmd)
break;
run_command(mpctx, cmd, NULL, NULL, NULL);
+ processed = 1;
}
mp_set_timeout(mpctx, mp_input_get_delay(mpctx->input));
+ if (processed)
+ mp_notify(mpctx, MP_EVENT_INPUT_PROCESSED, NULL);
}
double get_relative_time(struct MPContext *mpctx)