Skip to content

Commit 6f9aac5

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 simplying the code by not normalizing playlist filenames in several places, similar to 23b57e9 for tracks.
1 parent 3ae5521 commit 6f9aac5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

common/playlist.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ 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+
e->filename = local_filename ? local_filename : talloc_strdup(e, filename);
3537
e->stream_flags = STREAM_ORIGIN_DIRECT;
3638
e->original_index = -1;
3739
return e;

0 commit comments

Comments
 (0)