summaryrefslogtreecommitdiffstats
path: root/player/loadfile.c
diff options
context:
space:
mode:
authorGuido Cella <guido@guidocella.xyz>2023-08-27 21:48:59 +0200
committerDudemanguy <random342@airmail.cc>2023-08-28 18:31:17 +0000
commite1f9444d4da5eacb30359ae210b1f1d3831ca05c (patch)
tree768a669947e443bd9b83720ef70919716268be2c /player/loadfile.c
parent64959c450ddb05641e860c844e505380980104b7 (diff)
downloadmpv-e1f9444d4da5eacb30359ae210b1f1d3831ca05c.tar.bz2
mpv-e1f9444d4da5eacb30359ae210b1f1d3831ca05c.tar.xz
playlist: remove unused code to track redirects
It turns out that the code to track redirects (playlists and directories) never worked correctly, only the last redirect is remembered and num_redirects is never greater than 1. You can see this by doing quit-watch-later with the old watch later system, before dbf244fd2f, on a m3u playlist of files and a m3u playlist of directories. Only in the first case a redirect entry for the m3u file is created, because in the second case the m3u redirect is replaced by the directory one. If you did mpv --directory-mode=lazy /foo it did create redirect entries for all subdirectories e.g. /foo/bar, /foo/bar/baz, /foo/bar/baz/qux, this made it seem like it worked correctly, but actually /foo/bar/bar/qux was the only redirect entry and thus it was considered as the first redirect, and mpv created redirect entries for each segment of the first redirect only. In the previous commit dbf244fd2f, rather than figuring out how to fix the code to track redirects, and since creating redirect entries for multiple redirects is overkill, I just used the new playlist-path property which does the same thing but only for the last redirect. By replacing the only other use of the old redirect code with playlist-path, we can remove it.
Diffstat (limited to 'player/loadfile.c')
-rw-r--r--player/loadfile.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index d558ad6930..84cef94639 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -1086,8 +1086,6 @@ static void transfer_playlist(struct MPContext *mpctx, struct playlist *pl,
if (pl->num_entries) {
prepare_playlist(mpctx, pl);
struct playlist_entry *new = pl->current;
- if (mpctx->playlist->current)
- playlist_add_redirect(pl, mpctx->playlist->current->filename);
*num_new_entries = pl->num_entries;
*start_id = playlist_transfer_entries(mpctx->playlist, pl);
// current entry is replaced
@@ -1649,7 +1647,7 @@ static void play_current_file(struct MPContext *mpctx)
handle_force_window(mpctx, false);
if (mpctx->playlist->num_entries > 1 ||
- mpctx->playing->num_redirects)
+ mpctx->playing->playlist_path)
MP_INFO(mpctx, "Playing: %s\n", mpctx->filename);
assert(mpctx->demuxer == NULL);