test/run_input, ...: add struct ScopeIOThread
Auto-stop the IO thread in all error handlers.
This commit is contained in:
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "IOThread.hxx"
|
||||
#include "ScopeIOThread.hxx"
|
||||
#include "decoder/DecoderList.hxx"
|
||||
#include "decoder/DecoderPlugin.hxx"
|
||||
#include "FakeDecoderAPI.hxx"
|
||||
@ -56,8 +56,7 @@ int main(int argc, char **argv)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
io_thread_init();
|
||||
io_thread_start();
|
||||
const ScopeIOThread io_thread;
|
||||
|
||||
Error error;
|
||||
if (!input_stream_global_init(error)) {
|
||||
@ -98,7 +97,6 @@ int main(int argc, char **argv)
|
||||
|
||||
decoder_plugin_deinit_all();
|
||||
input_stream_global_finish();
|
||||
io_thread_deinit();
|
||||
|
||||
if (!decoder.initialized) {
|
||||
fprintf(stderr, "Decoding failed\n");
|
||||
|
Reference in New Issue
Block a user