mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-17 01:02:12 +00:00
fix windows build
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11678 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
14aba33e38
commit
ece81e6604
@ -46,7 +46,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_sound_test(switch_core_session_t *ses
|
|||||||
int16_t peak = 0;
|
int16_t peak = 0;
|
||||||
int16_t *data;
|
int16_t *data;
|
||||||
switch_frame_t *read_frame = NULL;
|
switch_frame_t *read_frame = NULL;
|
||||||
int i;
|
uint32_t i;
|
||||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||||
int64_t global_total = 0, global_sum = 0, period_sum = 0;
|
int64_t global_total = 0, global_sum = 0, period_sum = 0;
|
||||||
@ -88,7 +88,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_sound_test(switch_core_session_t *ses
|
|||||||
peak = 0;
|
peak = 0;
|
||||||
avg = 0;
|
avg = 0;
|
||||||
for (i = 0; i < read_frame->samples; i++) {
|
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) {
|
if (s > peak) {
|
||||||
peak = s;
|
peak = s;
|
||||||
}
|
}
|
||||||
@ -103,13 +103,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_sound_test(switch_core_session_t *ses
|
|||||||
global_total++;
|
global_total++;
|
||||||
period_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,
|
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);
|
"\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) {
|
if (period_total >= period_len) {
|
||||||
global_avg = global_sum / global_total;
|
global_avg = (int)(global_sum / global_total);
|
||||||
period_total = 0;
|
period_total = 0;
|
||||||
period_sum = 0;
|
period_sum = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user