mirror of
https://github.com/ericonr/sndio.git
synced 2024-02-18 04:45:21 -06:00
snd_pcm_poll_descriptors_count is not reliable use SIO_MAXNFDS
This commit is contained in:
parent
1e60e2e649
commit
1c240e397d
@ -269,11 +269,16 @@ sio_alsa_open(const char *str, unsigned mode, int nbio)
|
||||
goto bad_free_opcm;
|
||||
}
|
||||
}
|
||||
hdl->nfds = 0;
|
||||
if (mode & SIO_PLAY)
|
||||
hdl->nfds += snd_pcm_poll_descriptors_count(hdl->opcm);
|
||||
if (mode & SIO_REC)
|
||||
hdl->nfds += snd_pcm_poll_descriptors_count(hdl->ipcm);
|
||||
|
||||
/*
|
||||
* snd_pcm_poll_descriptors_count returns a small value
|
||||
* that grow later, after the stream is started
|
||||
*/
|
||||
hdl->nfds = SIO_MAXNFDS;
|
||||
//if (mode & SIO_PLAY)
|
||||
// hdl->nfds += snd_pcm_poll_descriptors_count(hdl->opcm);
|
||||
//if (mode & SIO_REC)
|
||||
// hdl->nfds += snd_pcm_poll_descriptors_count(hdl->ipcm);
|
||||
DPRINTF("mode = %d, nfds = %d\n", mode, hdl->nfds);
|
||||
|
||||
/*
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <sys/param.h>
|
||||
#include "sndio.h"
|
||||
|
||||
#define SIO_MAXNFDS 16
|
||||
#define SIO_MAXNFDS 4
|
||||
|
||||
/*
|
||||
* private ``handle'' structure
|
||||
|
Loading…
Reference in New Issue
Block a user