diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-03-05 01:52:18 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-03-05 01:52:18 +0000 |
commit | 8e1a7851aabb4e7f8682119cec0cafef06a50565 (patch) | |
tree | 67d320462724428a1c351d955f14181e800f4bc8 /main/rtp.c | |
parent | 515454767074ab49bcec99b0d78dbadeef5d0539 (diff) |
Fix a bug that I just noticed in the RTP code. The calculation for setting the
len field in an ast_frame of audio was wrong when G.722 is in use. The len field
represents the number of ms of audio that the frame contains. It would have
set the value to be twice what it should be.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@105932 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/rtp.c')
-rw-r--r-- | main/rtp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/main/rtp.c b/main/rtp.c index cec29dc4a..6578c400e 100644 --- a/main/rtp.c +++ b/main/rtp.c @@ -1313,7 +1313,7 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp) /* Add timing data to let ast_generic_bridge() put the frame into a jitterbuf */ ast_set_flag(&rtp->f, AST_FRFLAG_HAS_TIMING_INFO); rtp->f.ts = timestamp / 8; - rtp->f.len = rtp->f.samples / 8; + rtp->f.len = rtp->f.samples / ( (ast_format_rate(rtp->f.subclass) == 16000) ? 16 : 8 ); } else { /* Video -- samples is # of samples vs. 90000 */ if (!rtp->lastividtimestamp) |