[asterisk-commits] trunk r15969 - in /trunk: include/asterisk.h
include/asterisk/plc.h plc.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Tue Mar 28 19:12:34 MST 2006
Author: rizzo
Date: Tue Mar 28 20:12:31 2006
New Revision: 15969
URL: http://svn.digium.com/view/asterisk?rev=15969&view=rev
Log:
Add two widely used constants
#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.
Modified:
trunk/include/asterisk.h
trunk/include/asterisk/plc.h
trunk/plc.c
Modified: trunk/include/asterisk.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk.h?rev=15969&r1=15968&r2=15969&view=diff
==============================================================================
--- trunk/include/asterisk.h (original)
+++ trunk/include/asterisk.h Tue Mar 28 20:12:31 2006
@@ -19,6 +19,9 @@
#define _ASTERISK_H
#define DEFAULT_LANGUAGE "en"
+
+#define DEFAULT_SAMPLE_RATE 8000
+#define DEFAULT_SAMPLES_PER_MS ((DEFAULT_SAMPLE_RATE)/1000)
#define AST_CONFIG_MAX_PATH 255
Modified: trunk/include/asterisk/plc.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/plc.h?rev=15969&r1=15968&r2=15969&view=diff
==============================================================================
--- trunk/include/asterisk/plc.h (original)
+++ trunk/include/asterisk/plc.h Tue Mar 28 20:12:31 2006
@@ -95,8 +95,6 @@
That's it!
*/
-#define SAMPLE_RATE 8000
-
/*! Minimum allowed pitch (66 Hz) */
#define PLC_PITCH_MIN 120
/*! Maximum allowed pitch (200 Hz) */
Modified: trunk/plc.c
URL: http://svn.digium.com/view/asterisk/trunk/plc.c?rev=15969&r1=15968&r2=15969&view=diff
==============================================================================
--- trunk/plc.c (original)
+++ trunk/plc.c Tue Mar 28 20:12:31 2006
@@ -56,7 +56,7 @@
/* 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)
{
More information about the asterisk-commits
mailing list