diff options
author | Jaroslav Kysela <perex@perex.cz> | 2002-04-23 15:51:29 +0000 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2002-04-23 15:51:29 +0000 |
commit | c941c548f8ee3d3c05fb617514212f7eb4560124 (patch) | |
tree | d8c32b888921867d4525afc9b9c80be7d38ccd9d /src/pcm/pcm_hw.c | |
parent | f063381430a2bc4496d12079e9218c6ee7ce76e6 (diff) |
Moved ring buffer pointers and added a mechanism to transfer them via shm
Diffstat (limited to 'src/pcm/pcm_hw.c')
-rw-r--r-- | src/pcm/pcm_hw.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c index d441fea8..aeb8d374 100644 --- a/src/pcm/pcm_hw.c +++ b/src/pcm/pcm_hw.c @@ -29,6 +29,7 @@ #include <stdio.h> #include <stdlib.h> +#include <stddef.h> #include <unistd.h> #include <signal.h> #include <string.h> @@ -60,7 +61,7 @@ typedef struct { int fd; int card, device, subdevice; int mmap_emulation; - volatile struct sndrv_pcm_mmap_status *mmap_status; + volatile struct sndrv_pcm_mmap_status * mmap_status; struct sndrv_pcm_mmap_control *mmap_control; int shadow_appl_ptr: 1, avail_update_flag: 1, @@ -256,10 +257,10 @@ static int snd_pcm_hw_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) if (hw->mmap_shm) { hw->shadow_appl_ptr = 1; hw->appl_ptr = 0; - pcm->appl_ptr = &hw->appl_ptr; + snd_pcm_set_appl_ptr(pcm, &hw->appl_ptr, -1, 0); } else { hw->shadow_appl_ptr = 0; - pcm->appl_ptr = &hw->mmap_control->appl_ptr; + snd_pcm_set_appl_ptr(pcm, &hw->mmap_control->appl_ptr, hw->fd, SNDRV_PCM_MMAP_OFFSET_CONTROL); } } return 0; @@ -529,7 +530,7 @@ static int snd_pcm_hw_mmap_status(snd_pcm_t *pcm) return -errno; } hw->mmap_status = ptr; - pcm->hw_ptr = &hw->mmap_status->hw_ptr; + snd_pcm_set_hw_ptr(pcm, &hw->mmap_status->hw_ptr, hw->fd, SNDRV_PCM_MMAP_OFFSET_STATUS + offsetof(struct sndrv_pcm_mmap_status, hw_ptr)); return 0; } @@ -545,7 +546,7 @@ static int snd_pcm_hw_mmap_control(snd_pcm_t *pcm) return -errno; } hw->mmap_control = ptr; - pcm->appl_ptr = &hw->mmap_control->appl_ptr; + snd_pcm_set_appl_ptr(pcm, &hw->mmap_control->appl_ptr, hw->fd, SNDRV_PCM_MMAP_OFFSET_CONTROL); return 0; } |