aboutsummaryrefslogtreecommitdiffstats
path: root/src/input/Open.cxx
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/input/Open.cxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/input/Open.cxx b/src/input/Open.cxx
index 66ccdce74..6bcca0b84 100644
--- a/src/input/Open.cxx
+++ b/src/input/Open.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -26,6 +26,7 @@
#include "plugins/RewindInputPlugin.hxx"
#include "fs/Traits.hxx"
#include "fs/Path.hxx"
+#include "fs/AllocatedPath.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
@@ -34,10 +35,14 @@ InputStream::Open(const char *url,
Mutex &mutex, Cond &cond,
Error &error)
{
- if (PathTraitsFS::IsAbsolute(url))
- /* TODO: the parameter is UTF-8, not filesystem charset */
- return OpenLocalInputStream(Path::FromFS(url),
+ if (PathTraitsUTF8::IsAbsolute(url)) {
+ const auto path = AllocatedPath::FromUTF8(url, error);
+ if (path.IsNull())
+ return nullptr;
+
+ return OpenLocalInputStream(path,
mutex, cond, error);
+ }
input_plugins_for_each_enabled(plugin) {
InputStream *is;