tag/{Id3,Ape}: remove Path overloads

This commit is contained in:
Max Kellermann
2016-02-23 10:30:06 +01:00
parent a1e680fec7
commit cccbcf510a
12 changed files with 34 additions and 155 deletions

View File

@@ -22,8 +22,12 @@
#include "tag/TagRva2.hxx"
#include "ReplayGainInfo.hxx"
#include "config/ConfigGlobal.hxx"
#include "thread/Mutex.hxx"
#include "thread/Cond.hxx"
#include "util/Error.hxx"
#include "fs/Path.hxx"
#include "input/InputStream.hxx"
#include "input/LocalOpen.hxx"
#include "Log.hxx"
#include <id3tag.h>
@@ -54,16 +58,21 @@ int main(int argc, char **argv)
return EXIT_FAILURE;
}
const char *path = argv[1];
const Path path = Path::FromFS(argv[1]);
Mutex mutex;
Cond cond;
Error error;
const auto tag = tag_id3_load(Path::FromFS(path), error);
if (tag == NULL) {
if (error.IsDefined())
LogError(error);
else
fprintf(stderr, "No ID3 tag found\n");
auto is = OpenLocalInputStream(path, mutex, cond, error);
if (!is) {
LogError(error);
return EXIT_FAILURE;
}
const auto tag = tag_id3_load(*is);
if (tag == NULL) {
fprintf(stderr, "No ID3 tag found\n");
return EXIT_FAILURE;
}