aboutsummaryrefslogtreecommitdiff
path: root/src/listener.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/listener.c')
-rw-r--r--src/listener.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/listener.c b/src/listener.c
index f819383..1968590 100644
--- a/src/listener.c
+++ b/src/listener.c
@@ -14,6 +14,8 @@ char cam_data[BUF_CAP] = {0};
unsigned int WIDTH = 1;
unsigned int HEIGHT = 1;
+audio_handle aud_handle;
+
void *display_thread(void *arg)
{
(void)arg;
@@ -32,7 +34,7 @@ void on_recv(message *m)
HEIGHT = m->HEIGHT;
memcpy(cam_data, m->video, WIDTH * HEIGHT * 3);
- audio_play(m->audio);
+ audio_play(&aud_handle, m->audio);
}
int main(void)
@@ -40,6 +42,12 @@ int main(void)
pthread_t tid;
pthread_create(&tid, NULL, display_thread, NULL);
+ if(audio_create(&aud_handle, PLAYBACK) != 0) {
+ err("audio_create: failed\n");
+ return 1;
+ }
+
+
if(listener("4950", &on_recv) != 0) {
err("listener: failed");
return 1;