diff --git a/src/mod/endpoints/mod_woomera/mod_woomera.c b/src/mod/endpoints/mod_woomera/mod_woomera.c index c543765361..758e5f7ca1 100644 --- a/src/mod/endpoints/mod_woomera/mod_woomera.c +++ b/src/mod/endpoints/mod_woomera/mod_woomera.c @@ -396,7 +396,7 @@ static switch_status woomerachan_read_frame(switch_core_session *session, switch len = sizeof(tech_pvt->databuf); if (switch_socket_recvfrom(tech_pvt->udpread, tech_pvt->udp_socket, 0, tech_pvt->databuf, &len) == SWITCH_STATUS_SUCCESS) { - pframe->datalen = len; + pframe->datalen = (uint32_t)len; pframe->samples = (int) pframe->datalen / 2; return SWITCH_STATUS_SUCCESS; } @@ -425,7 +425,7 @@ static switch_status woomerachan_write_frame(switch_core_session *session, switc //pframe = &tech_pvt->frame; len = frame->datalen; if (switch_socket_sendto(tech_pvt->udp_socket, tech_pvt->udpwrite, 0, frame->data, &len) == SWITCH_STATUS_SUCCESS) { - frame->datalen = len; + frame->datalen = (uint32_t)len; return SWITCH_STATUS_SUCCESS; } diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 2628af3510..501e444b92 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -723,8 +723,8 @@ static int rtp_common_write(switch_rtp *rtp_session, void *data, uint32_t datale uint32_t rate; uint32_t flags; uint32_t len = sizeof(decoded); - send = 0; time_t now = time(NULL); + send = 0; if (rtp_session->vad_data.scan_freq && rtp_session->vad_data.next_scan <= now) { rtp_session->vad_data.bg_count = rtp_session->vad_data.bg_level = 0; @@ -742,13 +742,13 @@ static int rtp_common_write(switch_rtp *rtp_session, void *data, uint32_t datale &rate, &flags) == SWITCH_STATUS_SUCCESS) { - double energy = 0; + uint32_t energy = 0; uint32_t x, y = 0, z = len / sizeof(int16_t); uint32_t score = 0; if (z) { for (x = 0; x < z; x++) { - energy += abs(decoded[y] * 1.0); + energy += abs(decoded[y]); y += rtp_session->vad_data.read_codec->implementation->number_of_channels; }