From fccec2e5e4d6b67b3e39d4f22c7a0494c9528cef Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Fri, 2 Nov 2012 00:21:59 -0700 Subject: [PATCH] Use double for calculating duration. --- protocols/rdp/src/audio.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/protocols/rdp/src/audio.c b/protocols/rdp/src/audio.c index d517a73b..c6c5e0db 100644 --- a/protocols/rdp/src/audio.c +++ b/protocols/rdp/src/audio.c @@ -86,7 +86,7 @@ void audio_stream_begin(audio_stream* audio, int rate, int channels, int bps) { void audio_stream_end(audio_stream* audio) { - int duration; + double duration; rdp_guac_client_data* data = (rdp_guac_client_data*) audio->client->data; @@ -95,9 +95,8 @@ void audio_stream_end(audio_stream* audio) { audio->encoder->end_handler(audio); /* Calculate duration of PCM data */ - duration = - audio->pcm_bytes_written * 1000 * 8 / audio->rate - / audio->channels / audio->bps; + duration = ((double) (audio->pcm_bytes_written * 1000 * 8)) + / audio->rate / audio->channels / audio->bps; pthread_mutex_lock(&(data->update_lock));