mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-23 01:40:06 -05:00
Added snd_pcm_hwptr() and enhanced snd_pcm_mmap_begin() for no xrun mode.
This commit is contained in:
parent
a91efc0fe6
commit
fbd99fdec0
17 changed files with 231 additions and 13 deletions
|
|
@ -451,6 +451,19 @@ static int snd_pcm_shm_hwsync(snd_pcm_t *pcm)
|
|||
return snd_pcm_shm_action(pcm);
|
||||
}
|
||||
|
||||
static int snd_pcm_shm_hwptr(snd_pcm_t *pcm, snd_pcm_uframes_t *uframes)
|
||||
{
|
||||
snd_pcm_shm_t *shm = pcm->private_data;
|
||||
volatile snd_pcm_shm_ctrl_t *ctrl = shm->ctrl;
|
||||
int err;
|
||||
ctrl->cmd = SND_PCM_IOCTL_HWPTR;
|
||||
return snd_pcm_shm_action(pcm);
|
||||
if (err < 0)
|
||||
return err;
|
||||
*uframes = ctrl->u.hwptr.frames;
|
||||
return err;
|
||||
}
|
||||
|
||||
static int snd_pcm_shm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp)
|
||||
{
|
||||
snd_pcm_shm_t *shm = pcm->private_data;
|
||||
|
|
@ -619,6 +632,7 @@ static snd_pcm_fast_ops_t snd_pcm_shm_fast_ops = {
|
|||
status: snd_pcm_shm_status,
|
||||
state: snd_pcm_shm_state,
|
||||
hwsync: snd_pcm_shm_hwsync,
|
||||
hwptr: snd_pcm_shm_hwptr,
|
||||
delay: snd_pcm_shm_delay,
|
||||
prepare: snd_pcm_shm_prepare,
|
||||
reset: snd_pcm_shm_reset,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue