GUACAMOLE-25: Reset I/O counters upon end-of-stream.

This commit is contained in:
Michael Jumper 2016-06-01 16:20:38 -07:00
parent 0be04ea54d
commit 0d29694afc

View File

@ -247,9 +247,6 @@ void guac_rdp_audio_buffer_set_stream(guac_rdp_audio_buffer* audio_buffer,
audio_buffer->in_format.channels = channels; audio_buffer->in_format.channels = channels;
audio_buffer->in_format.bps = bps; audio_buffer->in_format.bps = bps;
/* Reset input counter */
audio_buffer->total_bytes_received = 0;
/* Acknowledge stream creation (if buffer is ready to receive) */ /* Acknowledge stream creation (if buffer is ready to receive) */
guac_rdp_audio_buffer_ack(audio_buffer, guac_rdp_audio_buffer_ack(audio_buffer,
"OK", GUAC_PROTOCOL_STATUS_SUCCESS); "OK", GUAC_PROTOCOL_STATUS_SUCCESS);
@ -274,9 +271,6 @@ void guac_rdp_audio_buffer_set_output(guac_rdp_audio_buffer* audio_buffer,
audio_buffer->out_format.channels = channels; audio_buffer->out_format.channels = channels;
audio_buffer->out_format.bps = bps; audio_buffer->out_format.bps = bps;
/* Reset output counter */
audio_buffer->total_bytes_sent = 0;
pthread_mutex_unlock(&(audio_buffer->lock)); pthread_mutex_unlock(&(audio_buffer->lock));
} }
@ -470,6 +464,10 @@ void guac_rdp_audio_buffer_end(guac_rdp_audio_buffer* audio_buffer) {
audio_buffer->packet_size = 0; audio_buffer->packet_size = 0;
audio_buffer->flush_handler = NULL; audio_buffer->flush_handler = NULL;
/* Reset I/O counters */
audio_buffer->total_bytes_sent = 0;
audio_buffer->total_bytes_received = 0;
/* Free packet (if any) */ /* Free packet (if any) */
free(audio_buffer->packet); free(audio_buffer->packet);
audio_buffer->packet = NULL; audio_buffer->packet = NULL;