aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_thread.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-29 22:34:37 +0100
committerMax Kellermann <max@duempel.org>2008-10-29 22:34:37 +0100
commitf8722913cf2f9d88cdc20a022c81d131c1728b17 (patch)
tree2ac32849414bea9ab267038c136425d1d582eb8e /src/output_thread.c
parent7da0e005f34bd8ce305b8ece7a33a8405bbaba87 (diff)
downloadmpd-f8722913cf2f9d88cdc20a022c81d131c1728b17.tar.gz
mpd-f8722913cf2f9d88cdc20a022c81d131c1728b17.tar.xz
mpd-f8722913cf2f9d88cdc20a022c81d131c1728b17.zip
output: removed audio_output.result
Since open() and play() close the device on error, we can simply check audio_output.open instead of audio_output.result after a call.
Diffstat (limited to '')
-rw-r--r--src/output_thread.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/output_thread.c b/src/output_thread.c
index 5d468c573..4209f2266 100644
--- a/src/output_thread.c
+++ b/src/output_thread.c
@@ -63,12 +63,13 @@ static void ao_play(struct audio_output *ao)
{
const char *data = ao->args.play.data;
size_t size = ao->args.play.size;
+ bool ret;
if (!audio_format_equals(&ao->inAudioFormat, &ao->outAudioFormat))
convertAudioFormat(ao, &data, &size);
- ao->result = ao->plugin->play(ao->data, data, size);
- if (!ao->result) {
+ ret = ao->plugin->play(ao->data, data, size);
+ if (!ret) {
ao->plugin->cancel(ao->data);
ao->plugin->close(ao->data);
ao->open = false;
@@ -96,6 +97,7 @@ static void ao_pause(struct audio_output *ao)
static void *audio_output_task(void *arg)
{
struct audio_output *ao = arg;
+ bool ret;
while (1) {
switch (ao->command) {
@@ -104,11 +106,11 @@ static void *audio_output_task(void *arg)
case AO_COMMAND_OPEN:
assert(!ao->open);
- ao->result = ao->plugin->open(ao->data,
- &ao->outAudioFormat);
+ ret = ao->plugin->open(ao->data,
+ &ao->outAudioFormat);
assert(!ao->open);
- if (ao->result == true)
+ if (ret == true)
ao->open = true;
else
ao->reopen_after = time(NULL) + REOPEN_AFTER;