Skip to content

Commit 0c67ad2

Browse files
committed
common/playlist: store normalized playlist filenames
This normalizes the playlist/N/filename sub-property, making it consistent with path. As a consequence playlist-path and stream-path are also normalized. This will allow simplifying the code by not normalizing playlist filenames in several places, similar to 23b57e9 for tracks.
1 parent e09a2f5 commit 0c67ad2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

common/playlist.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ struct playlist_entry *playlist_entry_new(const char *filename)
3131
{
3232
struct playlist_entry *e = talloc_zero(NULL, struct playlist_entry);
3333
char *local_filename = mp_file_url_to_filename(e, bstr0(filename));
34-
e->filename = local_filename ? local_filename : talloc_strdup(e, filename);
34+
e->filename = mp_normalize_path(e, local_filename ? local_filename : filename);
35+
if (e->filename) {
36+
talloc_free(local_filename);
37+
} else {
38+
e->filename = local_filename ? local_filename : talloc_strdup(e, filename);
39+
}
3540
e->stream_flags = STREAM_ORIGIN_DIRECT;
3641
e->original_index = -1;
3742
return e;

0 commit comments

Comments
 (0)