diff options
author | Max Kellermann <max@duempel.org> | 2014-02-07 18:52:19 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-02-07 18:52:19 +0100 |
commit | 6b421cc354cb0c297fcf99d7824b99b61caec99d (patch) | |
tree | e41f9fd76e3850da2716ab3dfd4fa08025f351f3 /src/decoder/plugins/MikmodDecoderPlugin.cxx | |
parent | 37ec29b225095e9c02b974134e056f8ba1a8678c (diff) | |
download | mpd-6b421cc354cb0c297fcf99d7824b99b61caec99d.tar.gz mpd-6b421cc354cb0c297fcf99d7824b99b61caec99d.tar.xz mpd-6b421cc354cb0c297fcf99d7824b99b61caec99d.zip |
DecoderPlugin: pass Path instance to file_decode() and scan_file()
Diffstat (limited to 'src/decoder/plugins/MikmodDecoderPlugin.cxx')
-rw-r--r-- | src/decoder/plugins/MikmodDecoderPlugin.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/decoder/plugins/MikmodDecoderPlugin.cxx b/src/decoder/plugins/MikmodDecoderPlugin.cxx index aacb5922d..a1938617d 100644 --- a/src/decoder/plugins/MikmodDecoderPlugin.cxx +++ b/src/decoder/plugins/MikmodDecoderPlugin.cxx @@ -22,6 +22,7 @@ #include "../DecoderAPI.hxx" #include "tag/TagHandler.hxx" #include "system/FatalError.hxx" +#include "fs/Path.hxx" #include "util/Domain.hxx" #include "Log.hxx" @@ -146,11 +147,11 @@ mikmod_decoder_finish(void) } static void -mikmod_decoder_file_decode(Decoder &decoder, const char *path_fs) +mikmod_decoder_file_decode(Decoder &decoder, Path path_fs) { /* deconstify the path because libmikmod wants a non-const string pointer */ - char *const path2 = const_cast<char *>(path_fs); + char *const path2 = const_cast<char *>(path_fs.c_str()); MODULE *handle; int ret; @@ -160,7 +161,7 @@ mikmod_decoder_file_decode(Decoder &decoder, const char *path_fs) if (handle == nullptr) { FormatError(mikmod_domain, - "failed to open mod: %s", path_fs); + "failed to open mod: %s", path_fs.c_str()); return; } @@ -184,18 +185,18 @@ mikmod_decoder_file_decode(Decoder &decoder, const char *path_fs) } static bool -mikmod_decoder_scan_file(const char *path_fs, +mikmod_decoder_scan_file(Path path_fs, const struct tag_handler *handler, void *handler_ctx) { /* deconstify the path because libmikmod wants a non-const string pointer */ - char *const path2 = const_cast<char *>(path_fs); + char *const path2 = const_cast<char *>(path_fs.c_str()); MODULE *handle = Player_Load(path2, 128, 0); if (handle == nullptr) { FormatDebug(mikmod_domain, - "Failed to open file: %s", path_fs); + "Failed to open file: %s", path_fs.c_str()); return false; } |