aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/audio.c8
-rw-r--r--src/output_control.c8
-rw-r--r--src/output_internal.h11
-rw-r--r--src/output_thread.c12
4 files changed, 12 insertions, 27 deletions
diff --git a/src/audio.c b/src/audio.c
index 45f36fff6..953b1a54e 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -247,11 +247,9 @@ bool playAudio(const char *buffer, size_t length)
if (!audio_output_is_open(ao))
continue;
- if (audio_output_command_is_finished(ao)) {
- bool success = audio_output_get_result(ao);
- if (success)
- ret = true;
- } else {
+ if (audio_output_command_is_finished(ao))
+ ret = true;
+ else {
finished = false;
audio_output_signal(ao);
}
diff --git a/src/output_control.c b/src/output_control.c
index c4c9510dc..f6ff6347a 100644
--- a/src/output_control.c
+++ b/src/output_control.c
@@ -55,8 +55,6 @@ bool
audio_output_open(struct audio_output *audioOutput,
const struct audio_format *audioFormat)
{
- bool ret = true;
-
audioOutput->reopen_after = 0;
if (audioOutput->open &&
@@ -83,12 +81,10 @@ audio_output_open(struct audio_output *audioOutput,
if (audioOutput->thread == 0)
audio_output_thread_start(audioOutput);
- if (!audioOutput->open) {
+ if (!audioOutput->open)
ao_command(audioOutput, AO_COMMAND_OPEN);
- ret = audioOutput->result;
- }
- return ret;
+ return audioOutput->open;
}
void
diff --git a/src/output_internal.h b/src/output_internal.h
index cfa231210..97b242551 100644
--- a/src/output_internal.h
+++ b/src/output_internal.h
@@ -109,11 +109,6 @@ struct audio_output {
const struct tag *tag;
} args;
-
- /**
- * Result value of the command. true means success.
- */
- bool result;
};
/**
@@ -134,10 +129,4 @@ audio_output_command_is_finished(const struct audio_output *ao)
return ao->command == AO_COMMAND_NONE;
}
-static inline bool
-audio_output_get_result(const struct audio_output *ao)
-{
- return ao->result;
-}
-
#endif
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;