From: Clemens Ladisch Date: Mon, 14 Jan 2008 07:50:46 +0000 (+0100) Subject: pcm hw plugin: use TSTAMP only with old drivers X-Git-Tag: v1.0.16rc1~10 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=07e1341548df13b3624cedf0e6be4c475bc3ad56;p=alsa-lib.git pcm hw plugin: use TSTAMP only with old drivers There is no need to call the TSTAMP ioctl with newer driver versions. --- diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c index 8f6e51e6..e5de7682 100644 --- a/src/pcm/pcm_hw.c +++ b/src/pcm/pcm_hw.c @@ -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)) 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 if (SNDRV_PROTOCOL_VERSION(2, 0, 9) <= ver) { 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; } #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)); if (!hw) {