aboutsummaryrefslogtreecommitdiff
path: root/src/listener.c
diff options
context:
space:
mode:
authorkartofen <mladenovnasko0@gmail.com>2022-10-22 23:53:29 +0300
committerkartofen <mladenovnasko0@gmail.com>2022-10-22 23:53:29 +0300
commitf45b143dcf90970122436d10bd6226f577a9310d (patch)
tree986563759bf1f5935e15a66613e673e445b26e97 /src/listener.c
parentf4c66a4c77e5818ca9703f59a80ea92e27ed45c6 (diff)
works with alsa and runs at 30 fpsHEADmaster
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;