aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-12-28 19:48:53 +0100
committerMax Kellermann <max@duempel.org>2008-12-28 19:48:53 +0100
commit4ca02bfcfc28b617aedf1ae9a9b274257cac6e37 (patch)
tree758cb6254b2d23d996ee5459277186329b58994b /src
parent7f78ed5b98358f7f87a38dbb7528f4dfc707ebef (diff)
downloadmpd-4ca02bfcfc28b617aedf1ae9a9b274257cac6e37.tar.gz
mpd-4ca02bfcfc28b617aedf1ae9a9b274257cac6e37.tar.xz
mpd-4ca02bfcfc28b617aedf1ae9a9b274257cac6e37.zip
mikmod: convert mod_Data.audio_buffer to a static array
Don't do two allocations for the mod_Data structure.
Diffstat (limited to '')
-rw-r--r--src/decoder/mod_plugin.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/decoder/mod_plugin.c b/src/decoder/mod_plugin.c
index a391b2c77..2d97d9ccb 100644
--- a/src/decoder/mod_plugin.c
+++ b/src/decoder/mod_plugin.c
@@ -123,7 +123,7 @@ static void mod_finishMikMod(void)
typedef struct _mod_Data {
MODULE *moduleHandle;
- SBYTE *audio_buffer;
+ SBYTE audio_buffer[MIKMOD_FRAME_SIZE];
} mod_Data;
static mod_Data *mod_open(const char *path)
@@ -144,7 +144,6 @@ static mod_Data *mod_open(const char *path)
data = xmalloc(sizeof(mod_Data));
- data->audio_buffer = xmalloc(MIKMOD_FRAME_SIZE);
data->moduleHandle = moduleHandle;
Player_Start(data->moduleHandle);
@@ -156,7 +155,6 @@ static void mod_close(mod_Data * data)
{
Player_Stop();
Player_Free(data->moduleHandle);
- free(data->audio_buffer);
free(data);
}