aboutsummaryrefslogtreecommitdiffstats
path: root/test/read_tags.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-12-29 18:08:49 +0100
committerMax Kellermann <max@duempel.org>2013-12-29 18:08:49 +0100
commitaeb2baa495776d9fc06e63f91167c40c334303c8 (patch)
tree4bbd926c1f19a64a1f3fc5b580d0d68bd3aabca3 /test/read_tags.cxx
parentea9aff1d3f9f68eb5ae9e5f2bd67d283b8c0f47e (diff)
downloadmpd-aeb2baa495776d9fc06e63f91167c40c334303c8.tar.gz
mpd-aeb2baa495776d9fc06e63f91167c40c334303c8.tar.xz
mpd-aeb2baa495776d9fc06e63f91167c40c334303c8.zip
InputStream: add static method OpenReady()
Merge some duplicate code.
Diffstat (limited to 'test/read_tags.cxx')
-rw-r--r--test/read_tags.cxx17
1 files changed, 2 insertions, 15 deletions
diff --git a/test/read_tags.cxx b/test/read_tags.cxx
index dac9aba00..d2cd162d2 100644
--- a/test/read_tags.cxx
+++ b/test/read_tags.cxx
@@ -113,26 +113,13 @@ int main(int argc, char **argv)
Mutex mutex;
Cond cond;
- InputStream *is = InputStream::Open(path, mutex, cond,
- error);
+ InputStream *is = InputStream::OpenReady(path, mutex, cond,
+ error);
if (is == NULL) {
FormatError(error, "Failed to open %s", path);
return EXIT_FAILURE;
}
- mutex.lock();
-
- is->WaitReady();
-
- if (!is->Check(error)) {
- mutex.unlock();
-
- FormatError(error, "Failed to read %s", path);
- return EXIT_FAILURE;
- }
-
- mutex.unlock();
-
success = plugin->ScanStream(*is, print_handler, nullptr);
is->Close();
}