aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-02-07 18:52:19 +0100
committerMax Kellermann <max@duempel.org>2014-02-07 18:52:19 +0100
commit6b421cc354cb0c297fcf99d7824b99b61caec99d (patch)
treee41f9fd76e3850da2716ab3dfd4fa08025f351f3 /test
parent37ec29b225095e9c02b974134e056f8ba1a8678c (diff)
downloadmpd-6b421cc354cb0c297fcf99d7824b99b61caec99d.tar.gz
mpd-6b421cc354cb0c297fcf99d7824b99b61caec99d.tar.xz
mpd-6b421cc354cb0c297fcf99d7824b99b61caec99d.zip
DecoderPlugin: pass Path instance to file_decode() and scan_file()
Diffstat (limited to 'test')
-rw-r--r--test/read_tags.cxx13
-rw-r--r--test/run_decoder.cxx3
2 files changed, 9 insertions, 7 deletions
diff --git a/test/read_tags.cxx b/test/read_tags.cxx
index b12aff11a..89253a78d 100644
--- a/test/read_tags.cxx
+++ b/test/read_tags.cxx
@@ -72,7 +72,7 @@ static const struct tag_handler print_handler = {
int main(int argc, char **argv)
{
- const char *decoder_name, *path;
+ const char *decoder_name;
const struct DecoderPlugin *plugin;
#ifdef HAVE_LOCALE_H
@@ -86,7 +86,7 @@ int main(int argc, char **argv)
}
decoder_name = argv[1];
- path = argv[2];
+ const Path path = Path::FromFS(argv[2]);
#if !GLIB_CHECK_VERSION(2,32,0)
g_thread_init(NULL);
@@ -114,10 +114,11 @@ int main(int argc, char **argv)
Mutex mutex;
Cond cond;
- InputStream *is = InputStream::OpenReady(path, mutex, cond,
+ InputStream *is = InputStream::OpenReady(path.c_str(),
+ mutex, cond,
error);
if (is == NULL) {
- FormatError(error, "Failed to open %s", path);
+ FormatError(error, "Failed to open %s", path.c_str());
return EXIT_FAILURE;
}
@@ -135,9 +136,9 @@ int main(int argc, char **argv)
}
if (empty) {
- tag_ape_scan2(Path::FromFS(path), &print_handler, NULL);
+ tag_ape_scan2(path, &print_handler, NULL);
if (empty)
- tag_id3_scan(Path::FromFS(path), &print_handler, NULL);
+ tag_id3_scan(path, &print_handler, NULL);
}
return 0;
diff --git a/test/run_decoder.cxx b/test/run_decoder.cxx
index 3e5f61778..f3bf93a3e 100644
--- a/test/run_decoder.cxx
+++ b/test/run_decoder.cxx
@@ -23,6 +23,7 @@
#include "decoder/DecoderAPI.hxx"
#include "input/Init.hxx"
#include "input/InputStream.hxx"
+#include "fs/Path.hxx"
#include "AudioFormat.hxx"
#include "util/Error.hxx"
#include "thread/Cond.hxx"
@@ -211,7 +212,7 @@ int main(int argc, char **argv)
decoder.initialized = false;
if (decoder.plugin->file_decode != NULL) {
- decoder.plugin->FileDecode(decoder, decoder.uri);
+ decoder.plugin->FileDecode(decoder, Path::FromFS(decoder.uri));
} else if (decoder.plugin->stream_decode != NULL) {
Mutex mutex;
Cond cond;