Commit 3d897f18 authored by Max Kellermann's avatar Max Kellermann

test/read_tags: use ScanGenericTags(InputStream&) after ScanStream()

parent 68c14d1e
...@@ -109,12 +109,12 @@ try { ...@@ -109,12 +109,12 @@ try {
success = false; success = false;
} }
if (!success && plugin->scan_stream != NULL) { Mutex mutex;
Mutex mutex; Cond cond;
Cond cond; InputStreamPtr is;
auto is = InputStream::OpenReady(path.c_str(), if (!success && plugin->scan_stream != NULL) {
mutex, cond); is = InputStream::OpenReady(path.c_str(), mutex, cond);
success = plugin->ScanStream(*is, print_handler, nullptr); success = plugin->ScanStream(*is, print_handler, nullptr);
} }
...@@ -123,8 +123,12 @@ try { ...@@ -123,8 +123,12 @@ try {
return EXIT_FAILURE; return EXIT_FAILURE;
} }
if (empty) if (empty) {
ScanGenericTags(path, print_handler, nullptr); if (is)
ScanGenericTags(*is, print_handler, nullptr);
else
ScanGenericTags(path, print_handler, nullptr);
}
return 0; return 0;
} catch (const std::exception &e) { } catch (const std::exception &e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment