aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-10-02 00:07:06 +0200
committerMax Kellermann <max@duempel.org>2012-10-02 00:17:53 +0200
commitfe8fc1081a9b9f5a086ee3f88230542c968ccc49 (patch)
tree516fb46e1340047b20ff01b5f06544c882ac83e3 /src
parentc7748fedab96da650c81f8a9fad7ec61a3bd96df (diff)
downloadmpd-fe8fc1081a9b9f5a086ee3f88230542c968ccc49.tar.gz
mpd-fe8fc1081a9b9f5a086ee3f88230542c968ccc49.tar.xz
mpd-fe8fc1081a9b9f5a086ee3f88230542c968ccc49.zip
output/shout: remove shout_buffer.len
Make it a local variable instead.
Diffstat (limited to 'src')
-rw-r--r--src/output/shout_output_plugin.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/output/shout_output_plugin.c b/src/output/shout_output_plugin.c
index bebc5e5da..1b5922e98 100644
--- a/src/output/shout_output_plugin.c
+++ b/src/output/shout_output_plugin.c
@@ -38,7 +38,6 @@
struct shout_buffer {
unsigned char data[32768];
- size_t len;
};
struct shout_data {
@@ -347,12 +346,12 @@ write_page(struct shout_data *sd, GError **error)
{
assert(sd->encoder != NULL);
- sd->buf.len = encoder_read(sd->encoder,
- sd->buf.data, sizeof(sd->buf.data));
- if (sd->buf.len == 0)
+ size_t nbytes = encoder_read(sd->encoder,
+ sd->buf.data, sizeof(sd->buf.data));
+ if (nbytes == 0)
return true;
- int err = shout_send(sd->shout_conn, sd->buf.data, sd->buf.len);
+ int err = shout_send(sd->shout_conn, sd->buf.data, nbytes);
if (!handle_shout_error(sd, err, error))
return false;
@@ -361,8 +360,6 @@ write_page(struct shout_data *sd, GError **error)
static void close_shout_conn(struct shout_data * sd)
{
- sd->buf.len = 0;
-
if (sd->encoder != NULL) {
if (encoder_end(sd->encoder, NULL))
write_page(sd, NULL);
@@ -437,8 +434,6 @@ my_shout_open_device(struct audio_output *ao, struct audio_format *audio_format,
if (!shout_connect(sd, error))
return false;
- sd->buf.len = 0;
-
if (!encoder_open(sd->encoder, audio_format, error)) {
shout_close(sd->shout_conn);
return false;