From 78f606078e347bc88e7888cc669184acf767c3ff Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 12 Apr 2008 04:16:56 +0000 Subject: let initOutputBuffer() allocate memory This is the first patch in a series which removes the shared memory, and moves all the playerData objects into the normal libc heap. git-svn-id: https://svn.musicpd.org/mpd/trunk@7304 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/playerData.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/playerData.c') diff --git a/src/playerData.c b/src/playerData.c index 27b69cfb2..c2de08512 100644 --- a/src/playerData.c +++ b/src/playerData.c @@ -74,11 +74,8 @@ void initPlayerData(void) buffered_before_play = buffered_chunks; } - allocationSize = buffered_chunks * sizeof(OutputBufferChunk); /*actual buffer */ - allocationSize += buffered_chunks * sizeof(float); /*for times */ - allocationSize += buffered_chunks * sizeof(mpd_sint16); /*for chunkSize */ - allocationSize += buffered_chunks * sizeof(mpd_sint16); /*for bitRate */ - allocationSize += sizeof(PlayerData); /*for playerData struct */ + /* for playerData struct */ + allocationSize = sizeof(PlayerData); /* for audioDeviceStates[] */ allocationSize += device_array_size; @@ -93,8 +90,7 @@ void initPlayerData(void) playerData_pd->audioDeviceStates = (mpd_uint8 *)playerData_pd + allocationSize - device_array_size; - initOutputBuffer(&(playerData_pd->buffer), - (OutputBufferChunk*)(((char *)playerData_pd) + sizeof(PlayerData))); + initOutputBuffer(&(playerData_pd->buffer)); notifyInit(&playerData_pd->playerControl.notify); playerData_pd->playerControl.stop = 0; -- cgit v1.2.3