diff options
author | Max Kellermann <max@duempel.org> | 2008-09-12 16:41:20 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-09-12 16:41:20 +0200 |
commit | 265b8fffb270325f62a15a842fe4498c87a08204 (patch) | |
tree | c1ba0da95d684c354a6284b1180a8b62f2d107c8 /src/audioOutputs/audioOutput_shout.c | |
parent | ebd194998aa6f140a0889a9d51fb356f76639361 (diff) | |
download | mpd-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 'src/audioOutputs/audioOutput_shout.c')
-rw-r--r-- | src/audioOutputs/audioOutput_shout.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/src/audioOutputs/audioOutput_shout.c b/src/audioOutputs/audioOutput_shout.c index f6f15ba49..f702acb00 100644 --- a/src/audioOutputs/audioOutput_shout.c +++ b/src/audioOutputs/audioOutput_shout.c @@ -25,8 +25,6 @@ #define CONN_ATTEMPT_INTERVAL 60 #define DEFAULT_CONN_TIMEOUT 2 -#define SHOUT_BUF_SIZE 8192 - static int shout_init_count; static const struct shout_encoder_plugin *const shout_encoder_plugins[] = { @@ -68,9 +66,6 @@ static struct shout_data *new_shout_data(void) ret->conn_attempts = 0; ret->last_attempt = 0; ret->timer = NULL; - ret->buf.data = xmalloc(sizeof(unsigned char) * - SHOUT_BUF_SIZE); - ret->buf.max_len = SHOUT_BUF_SIZE; clear_shout_buffer(ret); return ret; @@ -84,8 +79,6 @@ static void free_shout_data(struct shout_data *sd) shout_free(sd->shout_conn); if (sd->tag) tag_free(sd->tag); - if (sd->buf.data) - free(sd->buf.data); if (sd->timer) timer_free(sd->timer); |