aboutsummaryrefslogtreecommitdiff
path: root/pcm.c
diff options
context:
space:
mode:
authorSimon Wilson <simonwilson@google.com>2014-05-08 07:51:30 -0700
committerSimon Wilson <simonwilson@google.com>2014-05-08 07:51:30 -0700
commitac6b1b9d9d020809ebdf8d10f11dd6e46ea57e6d (patch)
tree45b7e95965b879a8747af6a338fa3273d03db0af /pcm.c
parent25e5e789c50105c1eca5bcfd37aa00327817fe45 (diff)
parent810124041268e4f0b20d271ddc566d11ecb8575f (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.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/pcm.c b/pcm.c
index b081e87..1a5254b 100644
--- a/pcm.c
+++ b/pcm.c
@@ -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;