aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist/PlaylistStream.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-03-05 08:55:13 +0100
committerMax Kellermann <max@duempel.org>2015-03-05 10:07:07 +0100
commit91a6fb81c1d0648687c8602be90650d5330c2128 (patch)
tree4fc0b26e2c30cb974e37d2406e39c81122562976 /src/playlist/PlaylistStream.cxx
parentc95f0820bcb8cffef8d03e73897edbf94fa1ad09 (diff)
downloadmpd-91a6fb81c1d0648687c8602be90650d5330c2128.tar.gz
mpd-91a6fb81c1d0648687c8602be90650d5330c2128.tar.xz
mpd-91a6fb81c1d0648687c8602be90650d5330c2128.zip
PlaylistStream: convert suffix to UTF-8
Diffstat (limited to 'src/playlist/PlaylistStream.cxx')
-rw-r--r--src/playlist/PlaylistStream.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/playlist/PlaylistStream.cxx b/src/playlist/PlaylistStream.cxx
index b0febba2b..99e1c3182 100644
--- a/src/playlist/PlaylistStream.cxx
+++ b/src/playlist/PlaylistStream.cxx
@@ -35,8 +35,12 @@ playlist_open_path_suffix(Path path, Mutex &mutex, Cond &cond)
{
assert(!path.IsNull());
- const char *suffix = path.GetSuffix();
- if (suffix == nullptr || !playlist_suffix_supported(suffix))
+ const auto *suffix = path.GetSuffix();
+ if (suffix == nullptr)
+ return nullptr;
+
+ const auto suffix_utf8 = Path::FromFS(suffix).ToUTF8();
+ if (!playlist_suffix_supported(suffix_utf8.c_str()))
return nullptr;
Error error;
@@ -46,7 +50,8 @@ playlist_open_path_suffix(Path path, Mutex &mutex, Cond &cond)
return nullptr;
}
- auto playlist = playlist_list_open_stream_suffix(*is, suffix);
+ auto playlist = playlist_list_open_stream_suffix(*is,
+ suffix_utf8.c_str());
if (playlist != nullptr)
playlist = new CloseSongEnumerator(playlist, is);
else