Commit 4ca02bfc authored by Max Kellermann's avatar Max Kellermann

mikmod: convert mod_Data.audio_buffer to a static array

Don't do two allocations for the mod_Data structure.
parent 7f78ed5b
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment