diff options
author | Qball Cow <qball@qballcow.nl> | 2005-11-16 14:43:04 +0000 |
---|---|---|
committer | Qball Cow <qball@qballcow.nl> | 2005-11-16 14:43:04 +0000 |
commit | 32e5f4ca2b43c310ff6639320dec2dd52f159f50 (patch) | |
tree | 5cc7966297e726b9b6cb961a28ec6979796acacb /src/playerData.c | |
parent | 402c8cd707640f7bd857c3387a03bb4db40222d7 (diff) |
DJWLindenaar balanced tree and master process patch
git-svn-id: https://svn.musicpd.org/mpd/trunk@3669 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/playerData.c')
-rw-r--r-- | src/playerData.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/playerData.c b/src/playerData.c index 281453548..060227f4b 100644 --- a/src/playerData.c +++ b/src/playerData.c @@ -34,6 +34,7 @@ int buffered_chunks; #define DEFAULT_BUFFER_BEFORE_PLAY 0 PlayerData * playerData_pd; +int * player_pid; void initPlayerData() { float perc = DEFAULT_BUFFER_BEFORE_PLAY; @@ -102,6 +103,22 @@ void initPlayerData() { ERROR("problems shmctl'ing\n"); exit(EXIT_FAILURE); } + /* maybe the following should be put in the same shm block as the previous + * or maybe even made a part of the playerData struct + */ + allocationSize = sizeof(int); + if((shmid = shmget(IPC_PRIVATE,allocationSize,IPC_CREAT|0600))<0) { + ERROR("problems shmget'ing\n"); + exit(EXIT_FAILURE); + } + if((player_pid = shmat(shmid,NULL,0))<0) { + ERROR("problems shmat'ing\n"); + exit(EXIT_FAILURE); + } + if (shmctl(shmid, IPC_RMID, 0)<0) { + ERROR("problems shmctl'ing\n"); + exit(EXIT_FAILURE); + } buffer = &(playerData_pd->buffer); @@ -147,6 +164,15 @@ PlayerData * getPlayerData() { return playerData_pd; } +int getPlayerPid() { + return *player_pid; +} + +void setPlayerPid(int pid) { + *player_pid = pid; +} + void freePlayerData() { shmdt(playerData_pd); + shmdt(player_pid); } |