aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-05 01:52:18 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-05 01:52:18 +0000
commit8e1a7851aabb4e7f8682119cec0cafef06a50565 (patch)
tree67d320462724428a1c351d955f14181e800f4bc8 /include
parent515454767074ab49bcec99b0d78dbadeef5d0539 (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 'include')
-rw-r--r--include/asterisk/frame.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/asterisk/frame.h b/include/asterisk/frame.h
index fc3481136..3f1543028 100644
--- a/include/asterisk/frame.h
+++ b/include/asterisk/frame.h
@@ -569,6 +569,17 @@ int ast_frame_adjust_volume(struct ast_frame *f, int adjustment);
*/
int ast_frame_slinear_sum(struct ast_frame *f1, struct ast_frame *f2);
+/*!
+ * \brief Get the sample rate for a given format.
+ */
+static force_inline int ast_format_rate(int format)
+{
+ if (format == AST_FORMAT_G722)
+ return 16000;
+
+ return 8000;
+}
+
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif