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

@@ -26,7 +26,7 @@
#include "Idle.hxx"
#include "Main.hxx"
#include "event/Loop.hxx"
#include "IOThread.hxx"
#include "ScopeIOThread.hxx"
#include "fs/Path.hxx"
#include "AudioParser.hxx"
#include "pcm/PcmConvert.hxx"
@@ -179,8 +179,7 @@ int main(int argc, char **argv)
EventLoop event_loop;
io_thread_init();
io_thread_start();
const ScopeIOThread io_thread;
/* initialize the audio output */
@@ -205,8 +204,6 @@ int main(int argc, char **argv)
audio_output_free(ao);
io_thread_deinit();
config_global_finish();
return success ? EXIT_SUCCESS : EXIT_FAILURE;