Fix compilation of PulseAudio handlers.

This commit is contained in:
Michael Jumper 2013-08-08 18:56:13 -07:00
parent 0b743fa68b
commit 3d2427d441
2 changed files with 7 additions and 5 deletions

View File

@ -125,7 +125,7 @@ finish:
void* guac_pa_send_audio(void* data) { void* guac_pa_send_audio(void* data) {
audio_args* args = (audio_args*) data; audio_args* args = (audio_args*) data;
audio_stream* audio = args->audio; guac_audio_stream* audio = args->audio;
buffer* audio_buffer = args->audio_buffer; buffer* audio_buffer = args->audio_buffer;
guac_client* client = audio->client; guac_client* client = audio->client;
unsigned char* buffer_data = malloc(sizeof(unsigned char) * BUF_DATA_SIZE); unsigned char* buffer_data = malloc(sizeof(unsigned char) * BUF_DATA_SIZE);
@ -135,13 +135,13 @@ void* guac_pa_send_audio(void* data) {
while (client->state == GUAC_CLIENT_RUNNING) { while (client->state == GUAC_CLIENT_RUNNING) {
audio_stream_begin(audio, SAMPLE_RATE, CHANNELS, BPS); guac_audio_stream_begin(audio, SAMPLE_RATE, CHANNELS, BPS);
counter = 0; counter = 0;
while (counter < BUF_LENGTH) { while (counter < BUF_LENGTH) {
buffer_remove(audio_buffer, (void *) buffer_data); buffer_remove(audio_buffer, (void *) buffer_data);
audio_stream_write_pcm(audio, buffer_data, BUF_DATA_SIZE); guac_audio_stream_write_pcm(audio, buffer_data, BUF_DATA_SIZE);
counter++; counter++;
if (client->state != GUAC_CLIENT_RUNNING) if (client->state != GUAC_CLIENT_RUNNING)
@ -149,7 +149,7 @@ void* guac_pa_send_audio(void* data) {
} }
audio_stream_end(audio); guac_audio_stream_end(audio);
guac_pa_sleep(SEND_INTERVAL); guac_pa_sleep(SEND_INTERVAL);
} }

View File

@ -40,6 +40,8 @@
#ifndef __GUAC_VNC_PA_HANDLERS_H #ifndef __GUAC_VNC_PA_HANDLERS_H
#define __GUAC_VNC_PA_HANDLERS_H #define __GUAC_VNC_PA_HANDLERS_H
#include <guacamole/audio.h>
/** /**
* The size of each data element in the audio buffer. * The size of each data element in the audio buffer.
*/ */
@ -75,7 +77,7 @@
* Arguments for the read and send threads * Arguments for the read and send threads
*/ */
typedef struct audio_args { typedef struct audio_args {
audio_stream* audio; guac_audio_stream* audio;
buffer* audio_buffer; buffer* audio_buffer;
} audio_args; } audio_args;