Implemented snd_pcm_avail() function.

More documentation updates for snd_pcm_avail_update() and snd_pcm_delay().
Updated behaviour of read/write functions (wait when buffer is full) to
follow kernel.
This commit is contained in:
Jaroslav Kysela 2002-10-11 18:39:24 +00:00
parent 25e41cf1e8
commit e859cf2644
11 changed files with 189 additions and 69 deletions

View file

@ -443,6 +443,19 @@ static snd_pcm_state_t snd_pcm_shm_state(snd_pcm_t *pcm)
return snd_pcm_shm_action(pcm);
}
static int snd_pcm_shm_avail(snd_pcm_t *pcm, snd_pcm_uframes_t *availp)
{
snd_pcm_shm_t *shm = pcm->private_data;
volatile snd_pcm_shm_ctrl_t *ctrl = shm->ctrl;
int err;
ctrl->cmd = SND_PCM_IOCTL_AVAIL;
err = snd_pcm_shm_action(pcm);
if (err < 0)
return err;
*availp = ctrl->u.avail.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;