Commit e0aa99bc authored by Simon Morlat's avatar Simon Morlat

fix apply of TOS field on windows.

parent 8b89ebee
......@@ -234,7 +234,7 @@ static void report_block_init(report_block_t *b, RtpSession *session){
/* compute the statistics */
if (stream->hwrcv_since_last_SR!=0){
int expected_packets=(int)((int64_t)stream->hwrcv_extseq - (int64_t)stream->hwrcv_seq_at_last_SR);
uint32_t expected_packets=(uint32_t)(stream->hwrcv_extseq - stream->hwrcv_seq_at_last_SR);
if ( session->flags & RTCP_OVERRIDE_LOST_PACKETS ) {
/* If the test mode is enabled, replace the lost packet field with
......@@ -245,7 +245,7 @@ static void report_block_init(report_block_t *b, RtpSession *session){
session->stats.cum_packet_loss = packet_loss;
}else {
/* Normal mode */
packet_loss = (int)((int64_t)expected_packets - (int64_t)stream->hwrcv_since_last_SR);
packet_loss = (int)(expected_packets - stream->hwrcv_since_last_SR);
session->stats.cum_packet_loss += packet_loss;
}
if (expected_packets>0){/*prevent division by zero and negative loss fraction*/
......
......@@ -368,7 +368,6 @@ rtp_session_set_local_addr (RtpSession * session, const char * addr, int rtp_por
}
/* set socket options (but don't change chosen states) */
rtp_session_set_dscp( session, -1 );
rtp_session_set_multicast_ttl( session, -1 );
rtp_session_set_multicast_loopback( session, -1 );
if (session->use_pktinfo) rtp_session_set_pktinfo(session, TRUE);
......@@ -899,7 +898,8 @@ _rtp_session_set_remote_addr_full (RtpSession * session, const char * rtp_addr,
} else {
ortp_message("RtpSession [%p] sending to rtp %s %s", session, rtp_printable_addr, is_aux ? "as auxiliary destination" : "");
}
/*Apply DSCP setting. On windows the destination address is required for doing this.*/
rtp_session_set_dscp(session, -1);
end:
if (is_aux){
if (err==-1){
......@@ -1787,6 +1787,12 @@ int rtp_session_update_remote_sock_addr(RtpSession * session, mblk_t * mp, bool
memcpy(rem_addr,&mp->net_addr,mp->net_addrlen);
*rem_addrlen = mp->net_addrlen;
#ifdef WIN32
if (is_rtp){
/*re-apply dscp settings for the new destination (windows specific).*/
rtp_session_set_dscp( session, -1 );
}
#endif
return 0;
}
return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment