diff options
author | Max Kellermann <max@duempel.org> | 2014-10-02 21:17:31 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-10-02 21:50:14 +0200 |
commit | 7e12aea1d8f90d375627acc9f4a532009781aa26 (patch) | |
tree | 9092dc1a8e12928af37e234f4b1d57f42891c8d3 /src/input/Open.cxx | |
parent | 20346b0da454a114a9eb3dc99fcdf5f984d45240 (diff) | |
download | mpd-7e12aea1d8f90d375627acc9f4a532009781aa26.tar.gz mpd-7e12aea1d8f90d375627acc9f4a532009781aa26.tar.xz mpd-7e12aea1d8f90d375627acc9f4a532009781aa26.zip |
input/Open: use OpenLocalInputStream()
Make the "open" method of plugins "file" and "archive" dummy methods
that always fail. Instead, let InputStream::Open() hard-code access
to these two plugins by using OpenLocalInputStream(). This allows
simplifyin the algorithm for falling back to probing archive plugins.
Diffstat (limited to 'src/input/Open.cxx')
-rw-r--r-- | src/input/Open.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/input/Open.cxx b/src/input/Open.cxx index 6e89569d6..18572d6b2 100644 --- a/src/input/Open.cxx +++ b/src/input/Open.cxx @@ -21,7 +21,10 @@ #include "InputStream.hxx" #include "Registry.hxx" #include "InputPlugin.hxx" +#include "LocalOpen.hxx" #include "plugins/RewindInputPlugin.hxx" +#include "fs/Traits.hxx" +#include "fs/Path.hxx" #include "util/Error.hxx" #include "util/Domain.hxx" @@ -32,6 +35,11 @@ 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), + mutex, cond, error); + input_plugins_for_each_enabled(plugin) { InputStream *is; |