DecoderPlugin: pass Path instance to file_decode() and scan_file()

This commit is contained in:
Max Kellermann
2014-02-07 18:52:19 +01:00
parent 37ec29b225
commit 6b421cc354
17 changed files with 103 additions and 82 deletions

View File

@@ -23,6 +23,7 @@
#include "input/InputStream.hxx"
#include "CheckAudioFormat.hxx"
#include "tag/TagHandler.hxx"
#include "fs/Path.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
#include "Log.hxx"
@@ -173,7 +174,7 @@ sndfile_stream_decode(Decoder &decoder, InputStream &is)
}
static bool
sndfile_scan_file(const char *path_fs,
sndfile_scan_file(Path path_fs,
const struct tag_handler *handler, void *handler_ctx)
{
SNDFILE *sf;
@@ -182,14 +183,14 @@ sndfile_scan_file(const char *path_fs,
info.format = 0;
sf = sf_open(path_fs, SFM_READ, &info);
sf = sf_open(path_fs.c_str(), SFM_READ, &info);
if (sf == nullptr)
return false;
if (!audio_valid_sample_rate(info.samplerate)) {
sf_close(sf);
FormatWarning(sndfile_domain,
"Invalid sample rate in %s", path_fs);
"Invalid sample rate in %s", path_fs.c_str());
return false;
}