mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-04 13:30:08 -05:00
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:
parent
6f751a923d
commit
07e1341548
1 changed files with 8 additions and 8 deletions
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue