From f2082174127ff1de3f1dbc24b98f907f8c98a57c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 24 Dec 2011 16:42:23 +0100 Subject: test/run_output: enable and disable the output --- test/run_output.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/run_output.c b/test/run_output.c index 5e688f2c7..bbb1be7d2 100644 --- a/test/run_output.c +++ b/test/run_output.c @@ -124,7 +124,15 @@ run_output(struct audio_output *ao, struct audio_format *audio_format) /* open the audio output */ GError *error = NULL; + if (!ao_plugin_enable(ao, &error)) { + g_printerr("Failed to enable audio output: %s\n", + error->message); + g_error_free(error); + return false; + } + if (!ao_plugin_open(ao, audio_format, &error)) { + ao_plugin_disable(ao); g_printerr("Failed to open audio output: %s\n", error->message); g_error_free(error); @@ -158,6 +166,7 @@ run_output(struct audio_output *ao, struct audio_format *audio_format) &error); if (consumed == 0) { ao_plugin_close(ao); + ao_plugin_disable(ao); g_printerr("Failed to play: %s\n", error->message); g_error_free(error); @@ -173,6 +182,7 @@ run_output(struct audio_output *ao, struct audio_format *audio_format) } ao_plugin_close(ao); + ao_plugin_disable(ao); return true; } -- cgit v1.2.3