tests: fix ChromaPrint test on Windows

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2024-01-03 12:28:08 -08:00
parent 468eceabff
commit fb9194b537
1 changed files with 4 additions and 3 deletions

View File

@ -10,6 +10,7 @@
#include "decoder/DecoderAPI.hxx" /* for class StopDecoder */ #include "decoder/DecoderAPI.hxx" /* for class StopDecoder */
#include "input/Init.hxx" #include "input/Init.hxx"
#include "input/InputStream.hxx" #include "input/InputStream.hxx"
#include "fs/NarrowPath.hxx"
#include "fs/Path.hxx" #include "fs/Path.hxx"
#include "pcm/AudioFormat.hxx" #include "pcm/AudioFormat.hxx"
#include "cmdline/OptionDef.hxx" #include "cmdline/OptionDef.hxx"
@ -29,7 +30,7 @@ struct CommandLine {
const char *decoder = nullptr; const char *decoder = nullptr;
const char *uri = nullptr; const char *uri = nullptr;
Path config_path = nullptr; FromNarrowPath config_path = nullptr;
bool verbose = false; bool verbose = false;
}; };
@ -53,7 +54,7 @@ ParseCommandLine(int argc, char **argv)
while (auto o = option_parser.Next()) { while (auto o = option_parser.Next()) {
switch (Option(o.index)) { switch (Option(o.index)) {
case OPTION_CONFIG: case OPTION_CONFIG:
c.config_path = Path::FromFS(o.value); c.config_path = o.value;
break; break;
case OPTION_VERBOSE: case OPTION_VERBOSE:
@ -112,7 +113,7 @@ try {
MyChromaprintDecoderClient client; MyChromaprintDecoderClient client;
if (plugin->file_decode != nullptr) { if (plugin->file_decode != nullptr) {
try { try {
plugin->FileDecode(client, Path::FromFS(c.uri)); plugin->FileDecode(client, FromNarrowPath(c.uri));
} catch (StopDecoder) { } catch (StopDecoder) {
} }
} else if (plugin->stream_decode != nullptr) { } else if (plugin->stream_decode != nullptr) {