FS-10319: fix casting
This commit is contained in:
parent
aa4aeb9fbe
commit
414f8085bb
|
@ -1522,7 +1522,7 @@ static uint8_t get_next_write_ts(switch_rtp_t *rtp_session, uint32_t timestamp)
|
||||||
rtp_session->ts = (uint32_t) timestamp;
|
rtp_session->ts = (uint32_t) timestamp;
|
||||||
changed++;
|
changed++;
|
||||||
/* Send marker bit if timestamp is lower/same as before (resetted/new timer) */
|
/* Send marker bit if timestamp is lower/same as before (resetted/new timer) */
|
||||||
if (abs((int64_t)rtp_session->ts - (int64_t)rtp_session->last_write_ts) > rtp_session->samples_per_interval
|
if (abs((int32_t)(rtp_session->ts - rtp_session->last_write_ts)) > rtp_session->samples_per_interval
|
||||||
&& !(rtp_session->rtp_bugs & RTP_BUG_NEVER_SEND_MARKER)) {
|
&& !(rtp_session->rtp_bugs & RTP_BUG_NEVER_SEND_MARKER)) {
|
||||||
m++;
|
m++;
|
||||||
}
|
}
|
||||||
|
@ -1961,12 +1961,12 @@ static int rtcp_stats(switch_rtp_t *rtp_session)
|
||||||
stats->period_pkt_count, pkt_seq, stats->cycle, stats->ssrc, rtp_session->write_timer.samplecount);
|
stats->period_pkt_count, pkt_seq, stats->cycle, stats->ssrc, rtp_session->write_timer.samplecount);
|
||||||
#endif
|
#endif
|
||||||
/* Interarrival jitter calculation */
|
/* Interarrival jitter calculation */
|
||||||
pkt_tsdiff = abs((int64_t)rtp_session->write_timer.samplecount - (int64_t)ntohl(hdr->ts)); /* relative transit times for this packet */
|
pkt_tsdiff = abs((int32_t)(rtp_session->write_timer.samplecount - ntohl(hdr->ts))); /* relative transit times for this packet */
|
||||||
if (stats->pkt_count < 2) { /* Can not compute Jitter with only one packet */
|
if (stats->pkt_count < 2) { /* Can not compute Jitter with only one packet */
|
||||||
stats->last_pkt_tsdiff = pkt_tsdiff;
|
stats->last_pkt_tsdiff = pkt_tsdiff;
|
||||||
} else {
|
} else {
|
||||||
/* Jitter : difference of relative transit times for the two packets */
|
/* Jitter : difference of relative transit times for the two packets */
|
||||||
packet_spacing_diff = abs((int64_t)pkt_tsdiff - (int64_t)stats->last_pkt_tsdiff);
|
packet_spacing_diff = abs((int32_t)(pkt_tsdiff - stats->last_pkt_tsdiff));
|
||||||
stats->last_pkt_tsdiff = pkt_tsdiff;
|
stats->last_pkt_tsdiff = pkt_tsdiff;
|
||||||
/* Interarrival jitter estimation, "J(i) = J(i-1) + ( |D(i-1,i)| - J(i-1) )/16" */
|
/* Interarrival jitter estimation, "J(i) = J(i-1) + ( |D(i-1,i)| - J(i-1) )/16" */
|
||||||
stats->inter_jitter = (stats->inter_jitter + (((double)packet_spacing_diff - stats->inter_jitter) /16.));
|
stats->inter_jitter = (stats->inter_jitter + (((double)packet_spacing_diff - stats->inter_jitter) /16.));
|
||||||
|
@ -8052,7 +8052,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
|
||||||
|
|
||||||
this_ts = ntohl(send_msg->header.ts);
|
this_ts = ntohl(send_msg->header.ts);
|
||||||
|
|
||||||
ts_delta = abs((int64_t)this_ts - (int64_t)rtp_session->last_write_ts);
|
ts_delta = abs((int32_t)(this_ts - rtp_session->last_write_ts));
|
||||||
|
|
||||||
if (ts_delta > rtp_session->samples_per_second * 2) {
|
if (ts_delta > rtp_session->samples_per_second * 2) {
|
||||||
rtp_session->flags[SWITCH_RTP_FLAG_RESET] = 1;
|
rtp_session->flags[SWITCH_RTP_FLAG_RESET] = 1;
|
||||||
|
|
Loading…
Reference in New Issue