test/run_input, ...: add struct ScopeIOThread

Auto-stop the IO thread in all error handlers.
This commit is contained in:
Max Kellermann
2014-10-07 20:02:13 +02:00
parent e5ff85b63c
commit 1aac0b10c9
9 changed files with 57 additions and 32 deletions

View File

@@ -25,7 +25,7 @@
#include "config/ConfigGlobal.hxx"
#include "decoder/DecoderList.hxx"
#include "input/Init.hxx"
#include "IOThread.hxx"
#include "ScopeIOThread.hxx"
#include "playlist/PlaylistRegistry.hxx"
#include "playlist/PlaylistPlugin.hxx"
#include "fs/Path.hxx"
@@ -82,8 +82,7 @@ int main(int argc, char **argv)
return EXIT_FAILURE;
}
io_thread_init();
io_thread_start();
const ScopeIOThread io_thread;
if (!input_stream_global_init(error)) {
LogError(error);
@@ -155,7 +154,6 @@ int main(int argc, char **argv)
decoder_plugin_deinit_all();
playlist_list_global_finish();
input_stream_global_finish();
io_thread_deinit();
config_global_finish();
return 0;