aboutsummaryrefslogtreecommitdiffstats
path: root/src/output
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-30 20:12:38 +0100
committerMax Kellermann <max@duempel.org>2009-01-30 20:12:38 +0100
commit231636b9eb2ecd7d8669d309a74c3a51cd5ddfae (patch)
treeec70993f5ce903e37dee4a49578c4c16bde222e7 /src/output
parent6aa734dc355ee3d8d3deb03adb4013dddc45694f (diff)
downloadmpd-231636b9eb2ecd7d8669d309a74c3a51cd5ddfae.tar.gz
mpd-231636b9eb2ecd7d8669d309a74c3a51cd5ddfae.tar.xz
mpd-231636b9eb2ecd7d8669d309a74c3a51cd5ddfae.zip
output_api: moved the command check out of method pause()
Move the "while" loop which checks for commands to the caller ao_pause(). This simplifies the pause() method, and lets us remove audio_output_is_pending().
Diffstat (limited to 'src/output')
-rw-r--r--src/output/shout_plugin.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/output/shout_plugin.c b/src/output/shout_plugin.c
index 3fc372250..d2a8db597 100644
--- a/src/output/shout_plugin.c
+++ b/src/output/shout_plugin.c
@@ -506,19 +506,12 @@ my_shout_play(void *data, const char *chunk, size_t size)
return true;
}
-static void my_shout_pause(void *data)
+static bool
+my_shout_pause(void *data)
{
- struct shout_data *sd = (struct shout_data *)data;
static const char silence[1020];
- int ret;
- /* play silence until the player thread sends us a command */
-
- while (sd->opened && !audio_output_is_pending(sd->audio_output)) {
- ret = my_shout_play(data, silence, sizeof(silence));
- if (ret != 0)
- break;
- }
+ return my_shout_play(data, silence, sizeof(silence));
}
static void my_shout_set_tag(void *data,