diff options
author | Simon Wilson <simonwilson@google.com> | 2014-05-08 07:51:30 -0700 |
---|---|---|
committer | Simon Wilson <simonwilson@google.com> | 2014-05-08 07:51:30 -0700 |
commit | ac6b1b9d9d020809ebdf8d10f11dd6e46ea57e6d (patch) | |
tree | 45b7e95965b879a8747af6a338fa3273d03db0af /pcm.c | |
parent | 25e5e789c50105c1eca5bcfd37aa00327817fe45 (diff) | |
parent | 810124041268e4f0b20d271ddc566d11ecb8575f (diff) |
Merge pull request #33 from gkasten/CL_avsync
pcm_get_htimestamp can now use CLOCK_MONOTONIC
Diffstat (limited to 'pcm.c')
-rw-r--r-- | pcm.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -724,6 +724,17 @@ struct pcm *pcm_open(unsigned int card, unsigned int device, goto fail; } +#ifdef SNDRV_PCM_IOCTL_TTSTAMP + if (pcm->flags & PCM_MONOTONIC) { + int arg = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC; + rc = ioctl(pcm->fd, SNDRV_PCM_IOCTL_TTSTAMP, &arg); + if (rc < 0) { + oops(pcm, rc, "cannot set timestamp type"); + goto fail; + } + } +#endif + pcm->underruns = 0; return pcm; |