aboutsummaryrefslogtreecommitdiffstats
path: root/src/audioOutputs/audioOutput_shout_mp3.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-12 16:41:20 +0200
committerMax Kellermann <max@duempel.org>2008-09-12 16:41:20 +0200
commit265b8fffb270325f62a15a842fe4498c87a08204 (patch)
treec1ba0da95d684c354a6284b1180a8b62f2d107c8 /src/audioOutputs/audioOutput_shout_mp3.c
parentebd194998aa6f140a0889a9d51fb356f76639361 (diff)
downloadmpd-265b8fffb270325f62a15a842fe4498c87a08204.tar.gz
mpd-265b8fffb270325f62a15a842fe4498c87a08204.tar.xz
mpd-265b8fffb270325f62a15a842fe4498c87a08204.zip
shout: make the shout_buffer static
Since the buffer size is known at compile time, we can save an indirection by declaring it as a char array instead of a pointer. That saves an extra allocation, and we can calculate with the compile-time constant sizeof(data) instead of the attribute "max_len".
Diffstat (limited to '')
-rw-r--r--src/audioOutputs/audioOutput_shout_mp3.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/audioOutputs/audioOutput_shout_mp3.c b/src/audioOutputs/audioOutput_shout_mp3.c
index 8e2bb565f..7bc3b5fba 100644
--- a/src/audioOutputs/audioOutput_shout_mp3.c
+++ b/src/audioOutputs/audioOutput_shout_mp3.c
@@ -160,7 +160,7 @@ static int shout_mp3_encoder_encode(struct shout_data *sd,
bytes_out = lame_encode_buffer_float(ld->gfp, lamebuf[0], lamebuf[1],
samples, buf->data,
- buf->max_len - buf->len);
+ sizeof(buf->data) - buf->len);
free(lamebuf);
if (0 > bytes_out) {