aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-12 16:42:14 +0200
committerMax Kellermann <max@duempel.org>2008-09-12 16:42:14 +0200
commit89c8b19a8c4a21e8ce578bd92120581f640fc2af (patch)
tree7efafbe096ca76cb1c0cd520bd932fc4a578b31f /src
parent42f617719995382bb417a18c33db4b8d3128113c (diff)
downloadmpd-89c8b19a8c4a21e8ce578bd92120581f640fc2af.tar.gz
mpd-89c8b19a8c4a21e8ce578bd92120581f640fc2af.tar.xz
mpd-89c8b19a8c4a21e8ce578bd92120581f640fc2af.zip
shout: don't write empty buffers
Add a check to write_page() which checks if there is actually data. Don't bother to call shout_send() if there is not.
Diffstat (limited to 'src')
-rw-r--r--src/audioOutputs/audioOutput_shout.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/audioOutputs/audioOutput_shout.c b/src/audioOutputs/audioOutput_shout.c
index 8f0bf45aa..61657b0aa 100644
--- a/src/audioOutputs/audioOutput_shout.c
+++ b/src/audioOutputs/audioOutput_shout.c
@@ -294,6 +294,9 @@ static int write_page(struct shout_data *sd)
{
int err;
+ if (sd->buf.len == 0)
+ return 0;
+
shout_sync(sd->shout_conn);
err = shout_send(sd->shout_conn, sd->buf.data, sd->buf.len);
if (handle_shout_error(sd, err) < 0)
@@ -426,8 +429,7 @@ static int open_shout_conn(struct audio_output *audio_output)
return -1;
}
- if (sd->buf.len)
- write_page(sd);
+ write_page(sd);
sd->shout_error = 0;
sd->opened = 1;