From dd577fb857141bc0d8bfa094a4697163b17deaad Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 4 Oct 2012 07:26:43 +0200 Subject: test/read_tags: wait until input_stream becomes ready Improved support for scanning http:// resources. --- test/read_tags.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'test') diff --git a/test/read_tags.c b/test/read_tags.c index faf9a45c0..09032efc7 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); -- cgit v1.2.3