aboutsummaryrefslogtreecommitdiffstats
path: root/src/output/shout_output_plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/output/shout_output_plugin.c')
-rw-r--r--src/output/shout_output_plugin.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/output/shout_output_plugin.c b/src/output/shout_output_plugin.c
index 63f1001ba..56456a0ea 100644
--- a/src/output/shout_output_plugin.c
+++ b/src/output/shout_output_plugin.c
@@ -342,14 +342,16 @@ write_page(struct shout_data *sd, GError **error)
{
assert(sd->encoder != NULL);
- size_t nbytes = encoder_read(sd->encoder,
- sd->buffer, sizeof(sd->buffer));
- if (nbytes == 0)
- return true;
-
- int err = shout_send(sd->shout_conn, sd->buffer, nbytes);
- if (!handle_shout_error(sd, err, error))
- return false;
+ while (true) {
+ size_t nbytes = encoder_read(sd->encoder,
+ sd->buffer, sizeof(sd->buffer));
+ if (nbytes == 0)
+ return true;
+
+ int err = shout_send(sd->shout_conn, sd->buffer, nbytes);
+ if (!handle_shout_error(sd, err, error))
+ return false;
+ }
return true;
}