diff options
author | Max Kellermann <max@duempel.org> | 2008-09-24 07:20:36 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-09-24 07:20:36 +0200 |
commit | 2403d32a5007572f853c7782957f86aedf3d3aff (patch) | |
tree | fe25886d65f49f3c18cd306a7ee4a94aeea3d24e /src/output_thread.c | |
parent | 3cae6856b8c6096b3f932a4ab30476a8d1187e58 (diff) | |
download | mpd-2403d32a5007572f853c7782957f86aedf3d3aff.tar.gz mpd-2403d32a5007572f853c7782957f86aedf3d3aff.tar.xz mpd-2403d32a5007572f853c7782957f86aedf3d3aff.zip |
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.
Diffstat (limited to 'src/output_thread.c')
-rw-r--r-- | src/output_thread.c | 8 |
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; |