summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-12-24 16:42:23 +0100
committerMax Kellermann <max@duempel.org>2011-12-24 18:15:20 +0100
commitf2082174127ff1de3f1dbc24b98f907f8c98a57c (patch)
treefce8b2543d5a1a895c6f29b60638934133580d33 /test
parent43c5058682e5e365204469b469d6bd0db12b71f9 (diff)
test/run_output: enable and disable the output
Diffstat (limited to 'test')
-rw-r--r--test/run_output.c10
1 files changed, 10 insertions, 0 deletions
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;
}