Commit 91a6fb81 authored by Max Kellermann's avatar Max Kellermann

PlaylistStream: convert suffix to UTF-8

parent c95f0820
...@@ -35,8 +35,12 @@ playlist_open_path_suffix(Path path, Mutex &mutex, Cond &cond) ...@@ -35,8 +35,12 @@ playlist_open_path_suffix(Path path, Mutex &mutex, Cond &cond)
{ {
assert(!path.IsNull()); assert(!path.IsNull());
const char *suffix = path.GetSuffix(); const auto *suffix = path.GetSuffix();
if (suffix == nullptr || !playlist_suffix_supported(suffix)) if (suffix == nullptr)
return nullptr;
const auto suffix_utf8 = Path::FromFS(suffix).ToUTF8();
if (!playlist_suffix_supported(suffix_utf8.c_str()))
return nullptr; return nullptr;
Error error; Error error;
...@@ -46,7 +50,8 @@ playlist_open_path_suffix(Path path, Mutex &mutex, Cond &cond) ...@@ -46,7 +50,8 @@ playlist_open_path_suffix(Path path, Mutex &mutex, Cond &cond)
return nullptr; 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) if (playlist != nullptr)
playlist = new CloseSongEnumerator(playlist, is); playlist = new CloseSongEnumerator(playlist, is);
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment