From 3d897f18cdd6924d011be6f59517ffeefce0cf52 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 9 Dec 2016 23:47:21 +0100 Subject: [PATCH] test/read_tags: use ScanGenericTags(InputStream&) after ScanStream() --- test/read_tags.cxx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/test/read_tags.cxx b/test/read_tags.cxx index 1742d3011..633e2330d 100644 --- a/test/read_tags.cxx +++ b/test/read_tags.cxx @@ -109,12 +109,12 @@ try { success = false; } - if (!success && plugin->scan_stream != NULL) { - Mutex mutex; - Cond cond; + Mutex mutex; + Cond cond; + InputStreamPtr is; - auto is = InputStream::OpenReady(path.c_str(), - mutex, cond); + if (!success && plugin->scan_stream != NULL) { + is = InputStream::OpenReady(path.c_str(), mutex, cond); success = plugin->ScanStream(*is, print_handler, nullptr); } @@ -123,8 +123,12 @@ try { return EXIT_FAILURE; } - if (empty) - ScanGenericTags(path, print_handler, nullptr); + if (empty) { + if (is) + ScanGenericTags(*is, print_handler, nullptr); + else + ScanGenericTags(path, print_handler, nullptr); + } return 0; } catch (const std::exception &e) {