pcm hw plugin: use TSTAMP only with old drivers

There is no need to call the TSTAMP ioctl with newer driver versions.
This commit is contained in:
Clemens Ladisch 2008-01-14 08:50:46 +01:00
parent 6f751a923d
commit 07e1341548

View file

@ -994,14 +994,6 @@ int snd_pcm_hw_open_fd(snd_pcm_t **pcmp, const char *name,
if (SNDRV_PROTOCOL_INCOMPATIBLE(ver, SNDRV_PCM_VERSION_MAX)) if (SNDRV_PROTOCOL_INCOMPATIBLE(ver, SNDRV_PCM_VERSION_MAX))
return -SND_ERROR_INCOMPATIBLE_VERSION; return -SND_ERROR_INCOMPATIBLE_VERSION;
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\n");
return ret;
}
}
#ifdef HAVE_CLOCK_GETTIME #ifdef HAVE_CLOCK_GETTIME
if (SNDRV_PROTOCOL_VERSION(2, 0, 9) <= ver) { if (SNDRV_PROTOCOL_VERSION(2, 0, 9) <= ver) {
int on = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC; int on = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC;
@ -1013,6 +1005,14 @@ int snd_pcm_hw_open_fd(snd_pcm_t **pcmp, const char *name,
monotonic = 1; monotonic = 1;
} }
#endif #endif
else 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\n");
return ret;
}
}
hw = calloc(1, sizeof(snd_pcm_hw_t)); hw = calloc(1, sizeof(snd_pcm_hw_t));
if (!hw) { if (!hw) {