output: set audio_output->open=1 in audio_output_task()

Since the output plugin returns a value indicating success or error,
we can have the output core code assign the "open" flag.
This commit is contained in:
Max Kellermann
2008-09-24 07:20:36 +02:00
parent 3cae6856b8
commit 2403d32a50
11 changed files with 8 additions and 39 deletions

View File

@@ -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;