]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Add two widely used constants
authorLuigi Rizzo <rizzo@icir.org>
Wed, 29 Mar 2006 02:12:31 +0000 (02:12 +0000)
committerLuigi Rizzo <rizzo@icir.org>
Wed, 29 Mar 2006 02:12:31 +0000 (02:12 +0000)
#define DEFAULT_SAMPLE_RATE 8000
#define DEFAULT_SAMPLES_PER_MS  ((DEFAULT_SAMPLE_RATE)/1000)

to the main header, and remove equivalent ones from plc.[ch]

This will simplify the cleanup of the codec/ and formats/ files.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@15969 65c4cc65-6c06-0410-ace0-fbb531ad65f3

include/asterisk.h
include/asterisk/plc.h
plc.c

index 7d052bbf3336305b0949f6233260cc6c8066ba27..97682423e1d71e135809711ca323c46ca7fdb4f8 100644 (file)
@@ -20,6 +20,9 @@
 
 #define DEFAULT_LANGUAGE "en"
 
+#define DEFAULT_SAMPLE_RATE 8000
+#define DEFAULT_SAMPLES_PER_MS  ((DEFAULT_SAMPLE_RATE)/1000)
+
 #define AST_CONFIG_MAX_PATH 255
 
 /* provided in asterisk.c */
index a790ca167fa1ba9c18b0d2c141b50d6f84316429..22eb738ac5e43ce46a154e1eb46890878f5de0ab 100644 (file)
@@ -95,8 +95,6 @@ When a real packet is not available in time, call plc_fillin() to create a sythe
 That's it!
 */
 
-#define SAMPLE_RATE     8000
-
 /*! Minimum allowed pitch (66 Hz) */
 #define PLC_PITCH_MIN           120
 /*! Maximum allowed pitch (200 Hz) */
diff --git a/plc.c b/plc.c
index 5db6f7d1b70a88c94828a97d48990fc470efde08..f088aa72e8da79f2c920b5836a66104aeb13f1b7 100644 (file)
--- a/plc.c
+++ b/plc.c
@@ -56,7 +56,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 /* We do a straight line fade to zero volume in 50ms when we are filling in for missing data. */
 #define ATTENUATION_INCREMENT       0.0025                           /* Attenuation per sample */
 
-#define ms_to_samples(t)           (((t)*SAMPLE_RATE)/1000)
+#define ms_to_samples(t)           (((t)*DEFAULT_SAMPLE_RATE)/1000)
 
 static inline int16_t fsaturate(double damp)
 {