poll: remove threads from alsa-sink

Remove the thread from alsa sink and use the pollfd event.
Make it possible to pass multiple fds in one pollfd event
Add 3 callbacks to the pollfd event and add support for timeouts
This commit is contained in:
Wim Taymans 2016-07-08 12:18:01 +02:00
parent ac59fa9371
commit 5fa334a89b
10 changed files with 313 additions and 202 deletions

View file

@ -20,7 +20,6 @@
#include <stddef.h>
#include <asoundlib.h>
#include <pthread.h>
#include <spa/node.h>
#include <spa/audio/format.h>
@ -58,8 +57,9 @@ typedef struct {
snd_pcm_sframes_t buffer_size;
snd_pcm_sframes_t period_size;
snd_pcm_channel_area_t areas[16];
pthread_t thread;
bool running;
SpaPollFd fds[16];
SpaPollItem poll;
} SpaALSAState;
typedef struct _ALSABuffer ALSABuffer;