GUACAMOLE-1283: Remove redundant parameters from guac_rdp_audio_buffer callback.

The buffer and data parameters of the guac_rdp_audio_buffer flush
handler are redundant now that the guac_rdp_audio_buffer is being passed
to the handler. They can instead be referenced as audio_buffer->packet
and audio_buffer->data respectively.
This commit is contained in:
Michael Jumper 2021-04-13 17:47:51 -07:00
parent 27e762d06f
commit bf6922b31e
3 changed files with 7 additions and 16 deletions

View File

@ -271,8 +271,8 @@ void guac_rdp_audio_buffer_write(guac_rdp_audio_buffer* audio_buffer,
/* Only actually invoke if defined */
if (audio_buffer->flush_handler)
audio_buffer->flush_handler(audio_buffer, audio_buffer->packet,
audio_buffer->bytes_written, audio_buffer->data);
audio_buffer->flush_handler(audio_buffer,
audio_buffer->bytes_written);
/* Reset buffer in all cases */
audio_buffer->bytes_written = 0;

View File

@ -36,23 +36,15 @@ typedef struct guac_rdp_audio_buffer guac_rdp_audio_buffer;
* buffer has reached capacity and must be flushed.
*
* @param audio_buffer
* The guac_rdp_audio_buffer that has reached capacity and is being
* The guac_rdp_audio_buffer that has reached capacity and needs to be
* flushed.
*
* @param buffer
* The buffer which needs to be flushed as an audio packet.
*
* @param length
* The number of bytes stored within the buffer. This is guaranteed to be
* identical to the packet_size value specified when the audio buffer was
* initialized.
*
* @param data
* The arbitrary data pointer provided when the audio buffer was
* initialized.
*/
typedef void guac_rdp_audio_buffer_flush_handler(guac_rdp_audio_buffer* audio_buffer,
char* buffer, int length, void* data);
typedef void guac_rdp_audio_buffer_flush_handler(guac_rdp_audio_buffer* audio_buffer, int length);
/**
* A description of an arbitrary PCM audio format.

View File

@ -333,17 +333,16 @@ void guac_rdp_ai_process_formats(guac_client* client,
}
void guac_rdp_ai_flush_packet(guac_rdp_audio_buffer* audio_buffer,
char* buffer, int length, void* data) {
void guac_rdp_ai_flush_packet(guac_rdp_audio_buffer* audio_buffer, int length) {
guac_client* client = audio_buffer->client;
guac_rdp_client* rdp_client = (guac_rdp_client*) client->data;
IWTSVirtualChannel* channel = (IWTSVirtualChannel*) data;
IWTSVirtualChannel* channel = (IWTSVirtualChannel*) audio_buffer->data;
/* Send data over channel */
pthread_mutex_lock(&(rdp_client->message_lock));
guac_rdp_ai_send_incoming_data(channel);
guac_rdp_ai_send_data(channel, buffer, length);
guac_rdp_ai_send_data(channel, audio_buffer->packet, length);
pthread_mutex_unlock(&(rdp_client->message_lock));
}