[Freeswitch-svn] [commit] r11678 - freeswitch/trunk/src
FreeSWITCH SVN
mikej at freeswitch.org
Fri Feb 6 15:49:22 PST 2009
Author: mikej
Date: Fri Feb 6 17:49:22 2009
New Revision: 11678
Log:
fix windows build
Modified:
freeswitch/trunk/src/switch_ivr.c
Modified: freeswitch/trunk/src/switch_ivr.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr.c (original)
+++ freeswitch/trunk/src/switch_ivr.c Fri Feb 6 17:49:22 2009
@@ -46,7 +46,7 @@
int16_t peak = 0;
int16_t *data;
switch_frame_t *read_frame = NULL;
- int i;
+ uint32_t i;
switch_channel_t *channel = switch_core_session_get_channel(session);
switch_status_t status = SWITCH_STATUS_SUCCESS;
int64_t global_total = 0, global_sum = 0, period_sum = 0;
@@ -88,7 +88,7 @@
peak = 0;
avg = 0;
for (i = 0; i < read_frame->samples; i++) {
- const int16_t s = abs(data[i]);
+ const int16_t s = (int16_t)abs(data[i]);
if (s > peak) {
peak = s;
}
@@ -103,13 +103,13 @@
global_total++;
period_total++;
- period_avg = period_sum / period_total;
+ period_avg = (int)(period_sum / period_total);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE,
"\npacket_avg=%d packet_peak=%d period_avg=%d global_avg=%d\n\n", avg, peak, period_avg, global_avg);
if (period_total >= period_len) {
- global_avg = global_sum / global_total;
+ global_avg = (int)(global_sum / global_total);
period_total = 0;
period_sum = 0;
}
More information about the Freeswitch-svn
mailing list