mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-31 22:25:35 -04:00
Fixed snd_pcm_wait() function
This commit is contained in:
parent
f073afbdfa
commit
ed9961c9a2
1 changed files with 4 additions and 4 deletions
|
|
@ -2008,11 +2008,11 @@ int snd_pcm_wait(snd_pcm_t *pcm, int timeout)
|
||||||
{
|
{
|
||||||
struct pollfd pfd;
|
struct pollfd pfd;
|
||||||
unsigned short revents;
|
unsigned short revents;
|
||||||
int err;
|
int err, err_poll;
|
||||||
err = snd_pcm_poll_descriptors(pcm, &pfd, 1);
|
err = snd_pcm_poll_descriptors(pcm, &pfd, 1);
|
||||||
assert(err == 1);
|
assert(err == 1);
|
||||||
err = poll(&pfd, 1, timeout);
|
err_poll = poll(&pfd, 1, timeout);
|
||||||
if (err < 0)
|
if (err_poll < 0)
|
||||||
return -errno;
|
return -errno;
|
||||||
err = snd_pcm_poll_descriptors_revents(pcm, &pfd, 1, &revents);
|
err = snd_pcm_poll_descriptors_revents(pcm, &pfd, 1, &revents);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
|
|
@ -2028,7 +2028,7 @@ int snd_pcm_wait(snd_pcm_t *pcm, int timeout)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return err > 0 ? 1 : 0;
|
return err_pol > 0 ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue