Cleaned the mmap_commit implementations in plugins.

Added undo callbacks for snd_pcm_plugin based plugins.
  - helpers when mmap_commit proceed only a partial transfer
Fixes to avail_update implementation in pcm_hw.c.
This commit is contained in:
Jaroslav Kysela 2002-02-21 15:01:34 +00:00
parent 9b0eebbcb7
commit e128bf856e
22 changed files with 260 additions and 120 deletions

View file

@ -396,9 +396,9 @@ static int snd_pcm_meter_resume(snd_pcm_t *pcm)
return snd_pcm_resume(meter->slave);
}
static int snd_pcm_meter_mmap_commit(snd_pcm_t *pcm,
snd_pcm_uframes_t offset,
snd_pcm_uframes_t size)
static snd_pcm_sframes_t snd_pcm_meter_mmap_commit(snd_pcm_t *pcm,
snd_pcm_uframes_t offset,
snd_pcm_uframes_t size)
{
snd_pcm_meter_t *meter = pcm->private_data;
snd_pcm_uframes_t old_rptr = *pcm->appl_ptr;
@ -406,10 +406,10 @@ static int snd_pcm_meter_mmap_commit(snd_pcm_t *pcm,
if (result <= 0)
return result;
if (pcm->stream == SND_PCM_STREAM_PLAYBACK) {
snd_pcm_meter_add_frames(pcm, snd_pcm_mmap_areas(pcm), old_rptr, size);
snd_pcm_meter_add_frames(pcm, snd_pcm_mmap_areas(pcm), old_rptr, result);
meter->rptr = *pcm->appl_ptr;
}
return 0;
return result;
}
static snd_pcm_sframes_t snd_pcm_meter_avail_update(snd_pcm_t *pcm)