summaryrefslogtreecommitdiff
path: root/rtp.c
diff options
context:
space:
mode:
authorMatteo Brancaleoni <mbrancaleoni@espia.it>2003-02-18 18:15:30 +0000
committerMatteo Brancaleoni <mbrancaleoni@espia.it>2003-02-18 18:15:30 +0000
commitcf3b725fe906080f6abf3f2ff16eb565660062aa (patch)
tree0de34ae75587bde85880b54639d681ab4e4b986a /rtp.c
parent9ea88c182549a8b4961b3fdd7dd63bd364671d52 (diff)
mar feb 18 19:15:15 CET 2003
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@618 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'rtp.c')
-rwxr-xr-xrtp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/rtp.c b/rtp.c
index ca5d7a1f2..a93823c43 100755
--- a/rtp.c
+++ b/rtp.c
@@ -116,7 +116,7 @@ void ast_rtp_set_callback(struct ast_rtp *rtp, ast_rtp_callback callback)
static struct ast_frame *send_dtmf(struct ast_rtp *rtp)
{
- printf("Sending dtmf: %d (%c)\n", rtp->resp, rtp->resp);
+ ast_log(LOG_DEBUG, "Sending dtmf: %d (%c)\n", rtp->resp, rtp->resp);
rtp->f.frametype = AST_FRAME_DTMF;
rtp->f.subclass = rtp->resp;
rtp->f.datalen = 0;
@@ -325,7 +325,7 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
/* Send any pending DTMF */
if (rtp->resp && !rtp->dtmfcount) {
- printf("Sending pending DTMF\n");
+ ast_log(LOG_DEBUG, "Sending pending DTMF\n");
return send_dtmf(rtp);
}
rtp->f.mallocd = 0;
@@ -581,7 +581,7 @@ static int ast_rtp_raw_write(struct ast_rtp *rtp, struct ast_frame *f, int codec
pred = rtp->lastts + f->datalen * 8;
break;
case AST_FORMAT_GSM:
- pred = rtp->lastts + f->datalen * 20 / 33;
+ pred = rtp->lastts + (f->datalen * 160 / 33);
break;
case AST_FORMAT_G723_1:
pred = rtp->lastts + g723_samples(f->data, f->datalen);
@@ -596,7 +596,7 @@ static int ast_rtp_raw_write(struct ast_rtp *rtp, struct ast_frame *f, int codec
/* If it's close to ou prediction, go for it */
if (abs(rtp->lastts - pred) < 640)
rtp->lastts = pred;
-#if 0
+#if 1
else
printf("Difference is %d, ms is %d\n", abs(rtp->lastts - pred), ms);
#endif