}
}
- if (!(mode & SND_PCM_APPEND)) {
#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
- if (SNDRV_PROTOCOL_VERSION(2, 0, 9) <= ver) {
- struct timespec timespec;
- if (clock_gettime(CLOCK_MONOTONIC, ×pec) == 0) {
+ if (SNDRV_PROTOCOL_VERSION(2, 0, 9) <= ver) {
+ struct timespec timespec;
+ if (clock_gettime(CLOCK_MONOTONIC, ×pec) == 0) {
+ if (!(mode & SND_PCM_APPEND)) {
int on = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC;
if (ioctl(fd, SNDRV_PCM_IOCTL_TTSTAMP, &on) < 0) {
ret = -errno;
SNDMSG("TTSTAMP failed");
return ret;
}
- tstamp_type = SND_PCM_TSTAMP_TYPE_MONOTONIC;
}
- } else
+ tstamp_type = SND_PCM_TSTAMP_TYPE_MONOTONIC;
+ }
+ } else
#endif
- if (SNDRV_PROTOCOL_VERSION(2, 0, 5) <= ver) {
- int on = 1;
- if (ioctl(fd, SNDRV_PCM_IOCTL_TSTAMP, &on) < 0) {
- ret = -errno;
- SNDMSG("TSTAMP failed");
- return ret;
- }
+ if (SNDRV_PROTOCOL_VERSION(2, 0, 5) <= ver && !(mode & SND_PCM_APPEND)) {
+ int on = 1;
+ if (ioctl(fd, SNDRV_PCM_IOCTL_TSTAMP, &on) < 0) {
+ ret = -errno;
+ SNDMSG("TSTAMP failed");
+ return ret;
}
}
-#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
- else {
- /* the first stream already sets this */
- tstamp_type = SND_PCM_TSTAMP_TYPE_MONOTONIC;
- }
-#endif
hw = calloc(1, sizeof(snd_pcm_hw_t));
if (!hw) {