aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-10-04 07:26:43 +0200
committerMax Kellermann <max@duempel.org>2012-10-04 09:28:13 +0200
commitdd577fb857141bc0d8bfa094a4697163b17deaad (patch)
treefe9bc92c4e0c571a2830588089e3436a01da5f7d /test
parentebd90dbb1a265d1a1c38252891cfe862a0d8a9b9 (diff)
test/read_tags: wait until input_stream becomes ready
Improved support for scanning http:// resources.
Diffstat (limited to 'test')
-rw-r--r--test/read_tags.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/read_tags.c b/test/read_tags.c
index faf9a45c..09032efc 100644
--- a/test/read_tags.c
+++ b/test/read_tags.c
@@ -218,6 +218,25 @@ int main(int argc, char **argv)
return 1;
}
+ g_mutex_lock(mutex);
+
+ while (!is->ready) {
+ g_cond_wait(cond, mutex);
+ input_stream_update(is);
+ }
+
+ if (!input_stream_check(is, &error)) {
+ g_mutex_unlock(mutex);
+
+ g_printerr("Failed to read %s: %s\n",
+ path, error->message);
+ g_error_free(error);
+
+ return EXIT_FAILURE;
+ }
+
+ g_mutex_unlock(mutex);
+
success = decoder_plugin_scan_stream(plugin, is,
&print_handler, NULL);
input_stream_close(is);