Implement missing htimestamp callbacks

Implemented the missing htimestamp callbacks for ioplug, rate and null
plugins.
This commit is contained in:
Takashi Iwai 2008-01-15 14:29:34 +01:00
parent 77849672cd
commit 91fc64cefb
5 changed files with 50 additions and 20 deletions

View file

@ -266,6 +266,28 @@ int snd_pcm_generic_htimestamp(snd_pcm_t *pcm, snd_pcm_uframes_t *avail,
return snd_pcm_htimestamp(generic->slave, avail, tstamp);
}
/* stand-alone version - similar like snd_pcm_hw_htimestamp but
* taking the tstamp via gettimestamp().
*/
int snd_pcm_generic_real_htimestamp(snd_pcm_t *pcm, snd_pcm_uframes_t *avail,
snd_htimestamp_t *tstamp)
{
snd_pcm_sframes_t avail1;
int ok = 0;
while (1) {
avail1 = snd_pcm_avail_update(pcm);
if (avail1 < 0)
return avail1;
if (ok && (snd_pcm_uframes_t)avail1 == *avail)
break;
*avail = avail1;
gettimestamp(tstamp, pcm->monotonic);
ok = 1;
}
return 0;
}
int snd_pcm_generic_mmap(snd_pcm_t *pcm)
{
if (pcm->mmap_shadow) {