diff --git a/src/protocols/vnc/guac_handlers.c b/src/protocols/vnc/guac_handlers.c index f5b7afad..a859ae8f 100644 --- a/src/protocols/vnc/guac_handlers.c +++ b/src/protocols/vnc/guac_handlers.c @@ -139,9 +139,6 @@ int vnc_guac_client_free_handler(guac_client* client) { if (guac_client_data->audio_send_thread) pthread_join(*(guac_client_data->audio_send_thread), NULL); - /* Free up buffer allocated for audio stream */ - if(guac_client_data->audio_buffer) - guac_pa_buffer_free(guac_client_data->audio_buffer); } #endif diff --git a/src/protocols/vnc/pa_handlers.c b/src/protocols/vnc/pa_handlers.c index 49affd4c..807190c4 100644 --- a/src/protocols/vnc/pa_handlers.c +++ b/src/protocols/vnc/pa_handlers.c @@ -43,7 +43,6 @@ #include #include -#include "buffer.h" #include "client.h" #include @@ -51,27 +50,10 @@ #include #include "pa_handlers.h" -buffer* guac_pa_buffer_alloc() { - - buffer* audio_buffer = malloc(sizeof(buffer)); - buffer_init(audio_buffer, BUF_LENGTH * 2, sizeof(unsigned char) * BUF_DATA_SIZE); - - return audio_buffer; - -} - -void guac_pa_buffer_free(buffer* audio_buffer) { - - buffer_free(audio_buffer); - free(audio_buffer); - -} - void* guac_pa_read_audio(void* data) { - audio_args* args = (audio_args*) data; - buffer* audio_buffer = args->audio_buffer; - guac_client* client = args->audio->client; + vnc_guac_client_data* client_data = (vnc_guac_client_data*) data; + guac_client* client = client_data->audio->client; pa_simple* s_in; int error; pa_usec_t latency; @@ -124,9 +106,8 @@ finish: void* guac_pa_send_audio(void* data) { - audio_args* args = (audio_args*) data; - guac_audio_stream* audio = args->audio; - buffer* audio_buffer = args->audio_buffer; + vnc_guac_client_data* client_data = (vnc_guac_client_data*) data; + guac_audio_stream* audio = client_data->audio; guac_client* client = audio->client; unsigned char* buffer_data = malloc(sizeof(unsigned char) * BUF_DATA_SIZE); int counter;