aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/output_thread.c')
-rw-r--r--src/output_thread.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/output_thread.c b/src/output_thread.c
index a93f5f64a..3f410958c 100644
--- a/src/output_thread.c
+++ b/src/output_thread.c
@@ -75,13 +75,19 @@ static void *audio_output_task(void *arg)
case AO_COMMAND_OPEN:
assert(!ao->open);
- ao->plugin->open(ao, &ao->outAudioFormat);
+ ao->result = ao->plugin->open(ao, &ao->outAudioFormat);
+
+ assert(!ao->open);
+ if (ao->result == 0)
+ ao->open = 1;
+
ao_command_finished(ao);
break;
case AO_COMMAND_CLOSE:
assert(ao->open);
ao->plugin->close(ao);
+ ao->open = 0;
ao_command_finished(ao);
break;