From 9cb1e2c58ca21f12b65167eb8a3640bda8eadfd5 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 9 Sep 2014 00:38:32 +0200 Subject: player: normalize playlist entries on add This is not necessarily more correct, but it's less trouble. --- common/playlist.c | 3 ++- player/loadfile.c | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/common/playlist.c b/common/playlist.c index d64db16e98..46ae36d643 100644 --- a/common/playlist.c +++ b/common/playlist.c @@ -30,7 +30,8 @@ struct playlist_entry *playlist_entry_new(const char *filename) { struct playlist_entry *e = talloc_zero(NULL, struct playlist_entry); - e->filename = talloc_strdup(e, filename); + char *local_filename = mp_file_url_to_filename(e, bstr0(filename)); + e->filename = local_filename ? local_filename : talloc_strdup(e, filename); return e; } diff --git a/player/loadfile.c b/player/loadfile.c index 9c6aabdd4e..d81bfa7bc8 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -1030,10 +1030,6 @@ static void play_current_file(struct MPContext *mpctx) if (!mpctx->filename) goto terminate_playback; - char *local_filename = mp_file_url_to_filename(tmp, bstr0(mpctx->filename)); - if (local_filename) - mpctx->filename = local_filename; - mpctx->add_osd_seek_info &= OSD_SEEK_INFO_EDITION; if (opts->reset_options) { -- cgit v1.2.3