Cannot use Alsa.PcmDevice.set_poll_descriptors_revents
I think there is an error in the alsa.vapi
. If I try to use Alsa.PcmDevice.set_poll_descriptors_revents
I get the following compiler error:
../src/AlsaDevice.vala:109:7: error: too many arguments to function 'snd_pcm_poll_descriptors_revents'
109 | int i = pcm.set_poll_descriptors_revents(pfd, revents);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/alsa/asoundlib.h:54,
from hwtest.p/src/AlsaDevice.c:8:
/usr/include/alsa/pcm.h:505:5: note: declared here
505 | int snd_pcm_poll_descriptors_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The function is defined as
[CCode (cname = "snd_pcm_poll_descriptors_revents")]
public int set_poll_descriptors_revents( Posix.pollfd[] pfds, ushort[] revents )
in alsa.vapi
but I think it should be
[CCode (cname = "snd_pcm_poll_descriptors_revents")]
public int set_poll_descriptors_revents( Posix.pollfd[] pfds, out ushort revents )
since it returns only a single event via revents
(alsa-doc):
Note: Even if multiple poll descriptors are used (i.e. pfds > 1), this function returns only a single event.