diff --git a/src/libguac/audio.c b/src/libguac/audio.c index 84e4c334..1f32d6d0 100644 --- a/src/libguac/audio.c +++ b/src/libguac/audio.c @@ -136,7 +136,7 @@ void guac_audio_stream_end(guac_audio_stream* audio) { /* Send audio */ guac_protocol_send_audio(audio->client->socket, audio->stream, - audio->encoder->mimetype, duration); + audio->stream->index, audio->encoder->mimetype, duration); guac_protocol_send_blob(audio->client->socket, audio->stream, audio->encoded_data, audio->encoded_data_used); diff --git a/src/libguac/guacamole/protocol.h b/src/libguac/guacamole/protocol.h index cad8e90c..dcc5045d 100644 --- a/src/libguac/guacamole/protocol.h +++ b/src/libguac/guacamole/protocol.h @@ -282,12 +282,13 @@ int guac_protocol_send_sync(guac_socket* socket, guac_timestamp timestamp); * * @param socket The guac_socket connection to use. * @param stream The stream to use. + * @param channel The index of the audio channel to use. * @param mimetype The mimetype of the data being sent. * @param duration The duration of the sound being sent, in milliseconds. * @return Zero on success, non-zero on error. */ int guac_protocol_send_audio(guac_socket* socket, const guac_stream* stream, - const char* mimetype, double duration); + int channel, const char* mimetype, double duration); /** * Sends a file instruction over the given guac_socket connection. diff --git a/src/libguac/protocol.c b/src/libguac/protocol.c index cba5980c..2cc2c2fb 100644 --- a/src/libguac/protocol.c +++ b/src/libguac/protocol.c @@ -417,7 +417,7 @@ int guac_protocol_send_arc(guac_socket* socket, const guac_layer* layer, } int guac_protocol_send_audio(guac_socket* socket, const guac_stream* stream, - const char* mimetype, double duration) { + int channel, const char* mimetype, double duration) { int ret_val; @@ -426,6 +426,8 @@ int guac_protocol_send_audio(guac_socket* socket, const guac_stream* stream, guac_socket_write_string(socket, "5.audio,") || __guac_socket_write_length_int(socket, stream->index) || guac_socket_write_string(socket, ",") + || __guac_socket_write_length_int(socket, channel) + || guac_socket_write_string(socket, ",") || __guac_socket_write_length_string(socket, mimetype) || guac_socket_write_string(socket, ",") || __guac_socket_write_length_double(socket, duration)