aboutsummaryrefslogtreecommitdiffstats
path: root/src/playerData.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-04-12 04:17:46 +0000
committerEric Wong <normalperson@yhbt.net>2008-04-12 04:17:46 +0000
commit288a7087f6bf981b4aa424c9bcfe8e83db587398 (patch)
tree488fd184302f69d36b2af83ec3ce1ddad7e0fe0e /src/playerData.c
parenteb5d51c98859b7c2c14dd7f7b9b9d83bd283f631 (diff)
downloadmpd-288a7087f6bf981b4aa424c9bcfe8e83db587398.tar.gz
mpd-288a7087f6bf981b4aa424c9bcfe8e83db587398.tar.xz
mpd-288a7087f6bf981b4aa424c9bcfe8e83db587398.zip
allocate playerData_pd from heap instead of shm
git-svn-id: https://svn.musicpd.org/mpd/trunk@7308 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/playerData.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/playerData.c b/src/playerData.c
index 863283757..1a2946a64 100644
--- a/src/playerData.c
+++ b/src/playerData.c
@@ -34,7 +34,6 @@ void initPlayerData(void)
{
float perc = DEFAULT_BUFFER_BEFORE_PLAY;
char *test;
- int shmid;
int crossfade = 0;
size_t bufferSize = DEFAULT_BUFFER_SIZE;
size_t allocationSize;
@@ -78,12 +77,7 @@ void initPlayerData(void)
/* for playerData struct */
allocationSize = sizeof(PlayerData);
- if ((shmid = shmget(IPC_PRIVATE, allocationSize, IPC_CREAT | 0600)) < 0)
- FATAL("problems shmget'ing\n");
- if (!(playerData_pd = shmat(shmid, NULL, 0)))
- FATAL("problems shmat'ing\n");
- if (shmctl(shmid, IPC_RMID, NULL) < 0)
- FATAL("problems shmctl'ing\n");
+ playerData_pd = xmalloc(allocationSize);
playerData_pd->audioDeviceStates = xmalloc(device_array_size);
@@ -129,5 +123,5 @@ void freePlayerData(void)
waitpid(-1, NULL, 0);
free(playerData_pd->audioDeviceStates);
- shmdt(playerData_pd);
+ free(playerData_pd);
}