summaryrefslogtreecommitdiffstats
path: root/input/event.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:14 +0000
commit60e8a3d404f0640fa5a3f834eae54b4f1fb9127d (patch)
tree1da89a218d0ecf010c67a87cb2f625c4cb18e7d7 /input/event.c
parentAdding upstream version 0.37.0. (diff)
downloadmpv-60e8a3d404f0640fa5a3f834eae54b4f1fb9127d.tar.xz
mpv-60e8a3d404f0640fa5a3f834eae54b4f1fb9127d.zip
Adding upstream version 0.38.0.upstream/0.38.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'input/event.c')
-rw-r--r--input/event.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/input/event.c b/input/event.c
index 266e029..6c1e004 100644
--- a/input/event.c
+++ b/input/event.c
@@ -37,6 +37,21 @@ void mp_event_drop_files(struct input_ctx *ictx, int num_files, char **files,
};
mp_input_run_cmd(ictx, cmd);
}
+ } else if (action == DND_INSERT_NEXT) {
+ /* To insert the entries in the correct order, we iterate over them
+ backwards */
+ for (int i = num_files - 1; i >= 0; i--) {
+ const char *cmd[] = {
+ "osd-auto",
+ "loadfile",
+ files[i],
+ /* Since we're inserting in reverse, wait til the final item
+ is added to start playing */
+ (i > 0) ? "insert-next" : "insert-next-play",
+ NULL
+ };
+ mp_input_run_cmd(ictx, cmd);
+ }
} else {
for (int i = 0; i < num_files; i++) {
const char *cmd[] = {