aboutsummaryrefslogtreecommitdiffstats
path: root/src/playerData.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2006-08-01 10:07:07 +0000
committerEric Wong <normalperson@yhbt.net>2006-08-01 10:07:07 +0000
commitc22a53d373f840569c56a1b3f6a774fc94b1e1e1 (patch)
tree17619e6e941790c0fb4871e451308496e57f28c7 /src/playerData.c
parent89073cfbba6126ce28221ad54e75a69b05b21fd6 (diff)
downloadmpd-c22a53d373f840569c56a1b3f6a774fc94b1e1e1.tar.gz
mpd-c22a53d373f840569c56a1b3f6a774fc94b1e1e1.tar.xz
mpd-c22a53d373f840569c56a1b3f6a774fc94b1e1e1.zip
audio: remove AUDIO_MAX_DEVICES limit
Some people have more than 8 devices (the old limit). It's pretty easy to support as many as our hardware and OS allows so we might as well. git-svn-id: https://svn.musicpd.org/mpd/trunk@4513 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/playerData.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/playerData.c b/src/playerData.c
index b5f8aadd4..f566b5c79 100644
--- a/src/playerData.c
+++ b/src/playerData.c
@@ -45,6 +45,7 @@ void initPlayerData(void)
size_t allocationSize;
OutputBuffer *buffer;
ConfigParam *param;
+ size_t device_array_size = audio_device_count() * sizeof(mpd_sint8);
param = getConfigParam(CONF_AUDIO_BUFFER_SIZE);
@@ -91,6 +92,9 @@ void initPlayerData(void)
allocationSize += buffered_chunks * sizeof(mpd_sint8); /*for metaChunk */
allocationSize += sizeof(PlayerData); /*for playerData struct */
+ /* for audioDeviceEnabled[] */
+ allocationSize += device_array_size;
+
if ((shmid = shmget(IPC_PRIVATE, allocationSize, IPC_CREAT | 0600)) < 0) {
ERROR("problems shmget'ing\n");
exit(EXIT_FAILURE);
@@ -104,6 +108,8 @@ void initPlayerData(void)
exit(EXIT_FAILURE);
}
+ playerData_pd->audioDeviceEnabled = (char *)playerData_pd +
+ allocationSize - device_array_size;
buffer = &(playerData_pd->buffer);
buffer->chunks = ((char *)playerData_pd) + sizeof(PlayerData);