[asterisk-scf-commits] asterisk-scf/integration/mediatransportudptl.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Thu Sep 29 16:00:40 CDT 2011


branch "master" has been updated
       via  7ee97e4877a0d560373e4e9a190563fc8eeab6bf (commit)
      from  3b1dd8ecd661bcab230acfd7e6ae3a7e2e759d7a (commit)

Summary of changes:
 src/UDPTLSink.cpp |    3 +--
 src/udptl.c       |   26 ++++++++++++++++----------
 2 files changed, 17 insertions(+), 12 deletions(-)


- Log -----------------------------------------------------------------
commit 7ee97e4877a0d560373e4e9a190563fc8eeab6bf
Author: Joshua Colp <jcolp at digium.com>
Date:   Thu Sep 29 18:00:26 2011 -0300

    Windowsify things.

diff --git a/src/UDPTLSink.cpp b/src/UDPTLSink.cpp
index 5170139..319e530 100644
--- a/src/UDPTLSink.cpp
+++ b/src/UDPTLSink.cpp
@@ -119,8 +119,7 @@ void StreamSinkUDPTLImpl::write(const AsteriskSCF::Media::V1::FrameSeq& frames,
 
     for (FrameSeq::const_iterator frame = frames.begin(); frame != frames.end(); ++frame)
     {
-        const int bufsize = udptl_get_far_max_datagram(mImpl->mUdptl);
-        uint8_t buf[bufsize];
+        uint8_t buf[1400];
         int len = 0;
 
         ByteSeqPayloadPtr payload = ByteSeqPayloadPtr::dynamicCast((*frame)->payload);
diff --git a/src/udptl.c b/src/udptl.c
index 3b66f5a..ccb9d27 100644
--- a/src/udptl.c
+++ b/src/udptl.c
@@ -48,7 +48,6 @@
  * - app_fax.c
  */
 
-#include <sys/time.h>
 #include <signal.h>
 #include <fcntl.h>
 #include <string.h>
@@ -255,18 +254,18 @@ struct udptl_frame *udptl_rx_packet(struct udptl *s, uint8_t *buf, unsigned int
 {
 	int stat1;
 	int stat2;
-	int i;
-	int j;
+	unsigned int i;
+	unsigned int j;
 	int k;
 	int l;
-	int m;
+	unsigned int m;
 	int x;
 	int limit;
 	int which;
 	unsigned int ptr;
 	unsigned int count;
 	int total_count;
-	int seq_no;
+	unsigned int seq_no;
 	const uint8_t *ifp = NULL;
 	const uint8_t *data = NULL;
 	unsigned int ifp_len = 0;
@@ -274,7 +273,7 @@ struct udptl_frame *udptl_rx_packet(struct udptl *s, uint8_t *buf, unsigned int
 	const uint8_t *bufs[ARRAY_LEN(s->f) - 1];
 	unsigned int lengths[ARRAY_LEN(s->f) - 1];
 	int span;
-	int entries;
+	unsigned int entries;
 	int ifp_no;
 
 	ptr = 0;
@@ -403,7 +402,7 @@ struct udptl_frame *udptl_rx_packet(struct udptl *s, uint8_t *buf, unsigned int
 					for (j = 0; j < s->rx[l].fec_len[m]; j++) {
 						s->rx[which].buf[j] = s->rx[l].fec[m][j];
 						for (k = (limit - s->rx[l].fec_span * s->rx[l].fec_entries) & UDPTL_BUF_MASK; k != limit; k = (k + s->rx[l].fec_entries) & UDPTL_BUF_MASK)
-							s->rx[which].buf[j] ^= (s->rx[k].buf_len > j) ? s->rx[k].buf[j] : 0;
+							s->rx[which].buf[j] ^= (s->rx[k].buf_len > (int)j) ? s->rx[k].buf[j] : 0;
 					}
 					s->rx[which].buf_len = s->rx[l].fec_len[m];
 					repaired[which] = 1;
@@ -450,7 +449,7 @@ int udptl_build_packet(struct udptl *s, uint8_t *buf, unsigned int buflen, uint8
 	uint8_t fec[LOCAL_FAX_MAX_DATAGRAM * 2];
 	int i;
 	int j;
-	int seq;
+	unsigned int seq;
 	int entry;
 	int entries;
 	int span;
@@ -592,7 +591,14 @@ static void calculate_local_max_datagram(struct udptl *udptl)
 		break;
 	}
 	/* add 5% extra space for insurance, but no larger than LOCAL_FAX_MAX_DATAGRAM */
-	udptl->local_max_datagram = MIN(new_max * 1.05, LOCAL_FAX_MAX_DATAGRAM);
+	if (LOCAL_FAX_MAX_DATAGRAM > (new_max * 1.05))
+	{
+		udptl->local_max_datagram = (int)(new_max * 1.05);
+	}
+	else
+	{
+		udptl->local_max_datagram = LOCAL_FAX_MAX_DATAGRAM;
+	}
 }
 
 static void calculate_far_max_ifp(struct udptl *udptl)
@@ -658,7 +664,7 @@ static void calculate_far_max_ifp(struct udptl *udptl)
 		break;
 	}
 	/* subtract 5% of space for insurance */
-	udptl->far_max_ifp = new_max * 0.95;
+	udptl->far_max_ifp = (int)(new_max * 0.95);
 }
 
 enum t38_ec_modes udptl_get_error_correction_scheme(const struct udptl *udptl)

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/mediatransportudptl.git



More information about the asterisk-scf-commits mailing list