summaryrefslogtreecommitdiffstats
path: root/demux/demux_playlist.c
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 /demux/demux_playlist.c
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 'demux/demux_playlist.c')
-rw-r--r--demux/demux_playlist.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/demux/demux_playlist.c b/demux/demux_playlist.c
index 63355be4ff..66be4b1270 100644
--- a/demux/demux_playlist.c
+++ b/demux/demux_playlist.c
@@ -202,7 +202,7 @@ static void pl_free_line(struct pl_parser *p, bstr line)
static void pl_add(struct pl_parser *p, bstr entry)
{
char *s = bstrto0(NULL, entry);
- playlist_add_file(p->pl, s);
+ playlist_append_file(p->pl, s);
talloc_free(s);
}
@@ -266,7 +266,7 @@ ok:
talloc_free(fn);
e->title = talloc_steal(e, title);
title = NULL;
- playlist_add(p->pl, e);
+ playlist_insert_at(p->pl, e, NULL);
}
pl_free_line(p, line);
line = pl_get_line(p);
@@ -296,7 +296,7 @@ static int parse_ref_init(struct pl_parser *p)
bstr burl = bstr0(p->s->url);
if (bstr_eatstart0(&burl, "http://") && check_mimetype(p->s, mmsh_types)) {
MP_INFO(p, "Redirecting to mmsh://\n");
- playlist_add_file(p->pl, talloc_asprintf(p, "mmsh://%.*s", BSTR_P(burl)));
+ playlist_append_file(p->pl, talloc_asprintf(p, "mmsh://%.*s", BSTR_P(burl)));
return 0;
}
@@ -456,7 +456,7 @@ static bool scan_dir(struct pl_parser *p, char *path,
scan_dir(p, file, dir_stack, num_dir_stack + 1);
}
else {
- playlist_add_file(p->pl, dir_entries[n].path);
+ playlist_append_file(p->pl, dir_entries[n].path);
}
}