mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-06 13:29:59 -05:00
Add support for monotonic timestamps
This commit is contained in:
parent
a73ad3f265
commit
309a274454
28 changed files with 77 additions and 25 deletions
|
|
@ -195,7 +195,7 @@ static int snd_pcm_dshare_sync_ptr(snd_pcm_t *pcm)
|
|||
dshare->avail_max = avail;
|
||||
if (avail >= pcm->stop_threshold) {
|
||||
snd_timer_stop(dshare->timer);
|
||||
gettimestamp(&dshare->trigger_tstamp);
|
||||
gettimestamp(&dshare->trigger_tstamp, pcm->monotonic);
|
||||
if (dshare->state == SND_PCM_STATE_RUNNING) {
|
||||
dshare->state = SND_PCM_STATE_XRUN;
|
||||
return -EPIPE;
|
||||
|
|
@ -229,7 +229,7 @@ static int snd_pcm_dshare_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
|
|||
if (pcm->tstamp_mode == SND_PCM_TSTAMP_MMAP)
|
||||
status->tstamp = snd_pcm_hw_fast_tstamp(dshare->spcm);
|
||||
else
|
||||
gettimestamp(&status->tstamp);
|
||||
gettimestamp(&status->tstamp, pcm->monotonic);
|
||||
status->avail = snd_pcm_mmap_playback_avail(pcm);
|
||||
status->avail_max = status->avail > dshare->avail_max ? status->avail : dshare->avail_max;
|
||||
dshare->avail_max = 0;
|
||||
|
|
@ -349,7 +349,7 @@ static int snd_pcm_dshare_start(snd_pcm_t *pcm)
|
|||
return err;
|
||||
snd_pcm_dshare_sync_area(pcm);
|
||||
}
|
||||
gettimestamp(&dshare->trigger_tstamp);
|
||||
gettimestamp(&dshare->trigger_tstamp, pcm->monotonic);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue