mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
Implement missing htimestamp callbacks
Implemented the missing htimestamp callbacks for ioplug, rate and null plugins.
This commit is contained in:
parent
77849672cd
commit
91fc64cefb
5 changed files with 50 additions and 20 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue