playlist: fix setting current item with autocreate-playlist

when the current directory isn't the playlist directory.
This commit is contained in:
llyyr 2024-08-23 04:13:38 +05:30 committed by Kacper Michajłow
parent b6f0599bfd
commit 92f052c14e
1 changed files with 1 additions and 1 deletions

View File

@ -446,7 +446,7 @@ void playlist_set_current(struct playlist *pl)
continue; continue;
char *path = pl->entries[i]->playlist_path; char *path = pl->entries[i]->playlist_path;
if (path[0] != '.') if (path[0] != '.')
path = mp_path_join(NULL, pl->playlist_dir, pl->entries[i]->playlist_path); path = mp_path_join(NULL, pl->playlist_dir, mp_basename(pl->entries[i]->playlist_path));
bool same = !strcmp(pl->entries[i]->filename, path); bool same = !strcmp(pl->entries[i]->filename, path);
if (path != pl->entries[i]->playlist_path) if (path != pl->entries[i]->playlist_path)
talloc_free(path); talloc_free(path);