summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorDavid Vaughan <david@davidv.xyz>2024-02-04 10:58:09 -0800
committerDudemanguy <random342@airmail.cc>2024-02-26 02:03:21 +0000
commitda753196af6593b2d6e94f691c9d1287b3ea093b (patch)
tree9960a897291bd8cf3f812031db9e45295fe14c72 /player
parenta8a314b829498c55aed393d4bc7f4f7bf9e92362 (diff)
downloadmpv-da753196af6593b2d6e94f691c9d1287b3ea093b.tar.bz2
mpv-da753196af6593b2d6e94f691c9d1287b3ea093b.tar.xz
player: change insert_next to insert_at
Change the `playlist_insert_next` function to `playlist_insert_at` (ie, insert at the location of an entry, rather than after it, and rename to be clearer that it doesn't have anything to do with the currently-playing entry). Also, replace calls to `playlist_add` with calls to `playlist_insert_at`, since the former has become redundant.
Diffstat (limited to 'player')
-rw-r--r--player/command.c9
-rw-r--r--player/misc.c2
2 files changed, 5 insertions, 6 deletions
diff --git a/player/command.c b/player/command.c
index cbb5d787fe..2c5c67e78a 100644
--- a/player/command.c
+++ b/player/command.c
@@ -5543,11 +5543,10 @@ static void cmd_loadfile(void *p)
playlist_entry_add_param(entry, bstr0(pairs[i]), bstr0(pairs[i + 1]));
}
- if (insert_next) {
- playlist_insert_next(mpctx->playlist, entry, mpctx->playlist->current);
- } else {
- playlist_add(mpctx->playlist, entry);
- }
+ struct playlist_entry *at = insert_next ?
+ playlist_get_next(mpctx->playlist, +1) : NULL;
+
+ playlist_insert_at(mpctx->playlist, entry, at);
struct mpv_node *res = &cmd->result;
node_init(res, MPV_FORMAT_NODE_MAP, NULL);
diff --git a/player/misc.c b/player/misc.c
index e267a53a46..693fa5a7e7 100644
--- a/player/misc.c
+++ b/player/misc.c
@@ -322,7 +322,7 @@ void merge_playlist_files(struct playlist *pl)
edl = talloc_strdup_append_buffer(edl, e->filename);
}
playlist_clear(pl);
- playlist_add_file(pl, edl);
+ playlist_append_file(pl, edl);
talloc_free(edl);
}