mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-06 13:29:59 -05:00
Cleanups in IPC stuff.
Cleanups in snd_pcm_close(). Added initial code for dmix plugin: - only skeleton, but all major problems should be solved
This commit is contained in:
parent
74859a4646
commit
8720faaccb
10 changed files with 1132 additions and 59 deletions
|
|
@ -282,6 +282,7 @@ int snd_pcm_channel_info_shm(snd_pcm_t *pcm, snd_pcm_channel_info_t *info,
|
|||
info->addr = 0;
|
||||
info->type = SND_PCM_AREA_SHM;
|
||||
info->u.shm.shmid = shmid;
|
||||
info->u.shm.remove = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -361,6 +362,7 @@ int snd_pcm_mmap(snd_pcm_t *pcm)
|
|||
return -errno;
|
||||
}
|
||||
i->u.shm.shmid = id;
|
||||
i->u.shm.remove = 1;
|
||||
}
|
||||
ptr = shmat(i->u.shm.shmid, 0, 0);
|
||||
if (ptr == (void*) -1) {
|
||||
|
|
@ -438,6 +440,14 @@ int snd_pcm_munmap(snd_pcm_t *pcm)
|
|||
SYSERR("shmdt failed");
|
||||
return -errno;
|
||||
}
|
||||
if (i->u.shm.remove) {
|
||||
if (shmctl(i->u.shm.shmid, IPC_RMID, 0) < 0) {
|
||||
SYSERR("shmctl IPC_RMID failed");
|
||||
return -errno;
|
||||
}
|
||||
i->u.shm.shmid = -1;
|
||||
i->u.shm.remove = 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue