aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/slin.h
diff options
context:
space:
mode:
authorjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2010-06-02 17:29:35 +0000
committerjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2010-06-02 17:29:35 +0000
commitd0159c5a6effbdf123735cc5f0e6c8f78cd03746 (patch)
tree29e1c650a8ec0cf21e57557581b188b4c67f1672 /include/asterisk/slin.h
parent32c13d574792c0e5bc1d7e473aa038a063578bf6 (diff)
Fix infinite loop when loading codec speex
This changes the sample slinear frame data to contain non-zero data so that translation calculations for speex works when preprocessing and VAD is turned on. The encoder expects samples to be returned, but when attempted with the mentioned two options and silent sample frames everything was discarded. (closes issue #17240) Reported by: seandarcy Review: https://reviewboard.asterisk.org/r/682/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@267065 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/slin.h')
-rw-r--r--include/asterisk/slin.h96
1 files changed, 36 insertions, 60 deletions
diff --git a/include/asterisk/slin.h b/include/asterisk/slin.h
index 5ba5af580..3f6737f15 100644
--- a/include/asterisk/slin.h
+++ b/include/asterisk/slin.h
@@ -16,70 +16,46 @@
* at the top of the source tree.
*/
+/* Source: beep.gsm
+ * Converted to beep.sln via file convert, then converted to hex:
+ * od -An -tx1 beep.sln | awk '{for (i=1; i<NF; i++) printf "0x%s, ", $i} {printf("0x%s,\n", $NF)}'
+ * Samples were truncated at 160 and 320 bytes.
+ */
+
static uint8_t ex_slin8[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x60, 0x00, 0x68, 0x00, 0x48, 0x00, 0xc8, 0xff, 0xa8, 0xff, 0xc8, 0xff, 0x40, 0x00,
+ 0x60, 0x00, 0x40, 0x00, 0x80, 0x00, 0x80, 0x00, 0x58, 0x00, 0x00, 0xff, 0x50, 0xfe, 0xa0, 0xfe,
+ 0xd8, 0xff, 0xc0, 0x00, 0xe0, 0x00, 0x58, 0x02, 0xa8, 0x02, 0xb0, 0x01, 0xf0, 0xff, 0xf8, 0xfe,
+ 0x00, 0xff, 0x00, 0xfd, 0x78, 0xfc, 0x00, 0xfe, 0x48, 0x00, 0x38, 0x02, 0x40, 0x03, 0x20, 0x04,
+ 0x78, 0x03, 0x90, 0x01, 0x00, 0xff, 0x38, 0xfd, 0xe8, 0xfc, 0x18, 0xfc, 0x90, 0xfc, 0x48, 0xfe,
+ 0xe0, 0x00, 0x50, 0x03, 0x10, 0x05, 0x88, 0x05, 0x58, 0x04, 0x88, 0x01, 0x68, 0xfe, 0xe8, 0xfb,
+ 0x80, 0xfa, 0x90, 0xfa, 0x30, 0xfc, 0xb0, 0xff, 0x68, 0x03, 0x18, 0x06, 0x20, 0x07, 0x48, 0x06,
+ 0xb0, 0x03, 0x50, 0xff, 0xc0, 0xfa, 0xd0, 0xf7, 0xd8, 0xf6, 0x88, 0xf8, 0x50, 0xfc, 0x48, 0x01,
+ 0x48, 0x06, 0x70, 0x09, 0xe0, 0x09, 0x50, 0x07, 0xa8, 0x02, 0xe0, 0xfc, 0x20, 0xf7, 0xf0, 0xf3,
+ 0x68, 0xf5, 0xf8, 0xf9, 0x10, 0x00, 0x78, 0x06, 0x70, 0x0b, 0x00, 0x0d, 0xd8, 0x0a, 0xa8, 0x05,
};
static uint8_t ex_slin16[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x60, 0x00, 0x68, 0x00, 0x48, 0x00, 0xc8, 0xff, 0xa8, 0xff, 0xc8, 0xff, 0x40, 0x00,
+ 0x60, 0x00, 0x40, 0x00, 0x80, 0x00, 0x80, 0x00, 0x58, 0x00, 0x00, 0xff, 0x50, 0xfe, 0xa0, 0xfe,
+ 0xd8, 0xff, 0xc0, 0x00, 0xe0, 0x00, 0x58, 0x02, 0xa8, 0x02, 0xb0, 0x01, 0xf0, 0xff, 0xf8, 0xfe,
+ 0x00, 0xff, 0x00, 0xfd, 0x78, 0xfc, 0x00, 0xfe, 0x48, 0x00, 0x38, 0x02, 0x40, 0x03, 0x20, 0x04,
+ 0x78, 0x03, 0x90, 0x01, 0x00, 0xff, 0x38, 0xfd, 0xe8, 0xfc, 0x18, 0xfc, 0x90, 0xfc, 0x48, 0xfe,
+ 0xe0, 0x00, 0x50, 0x03, 0x10, 0x05, 0x88, 0x05, 0x58, 0x04, 0x88, 0x01, 0x68, 0xfe, 0xe8, 0xfb,
+ 0x80, 0xfa, 0x90, 0xfa, 0x30, 0xfc, 0xb0, 0xff, 0x68, 0x03, 0x18, 0x06, 0x20, 0x07, 0x48, 0x06,
+ 0xb0, 0x03, 0x50, 0xff, 0xc0, 0xfa, 0xd0, 0xf7, 0xd8, 0xf6, 0x88, 0xf8, 0x50, 0xfc, 0x48, 0x01,
+ 0x48, 0x06, 0x70, 0x09, 0xe0, 0x09, 0x50, 0x07, 0xa8, 0x02, 0xe0, 0xfc, 0x20, 0xf7, 0xf0, 0xf3,
+ 0x68, 0xf5, 0xf8, 0xf9, 0x10, 0x00, 0x78, 0x06, 0x70, 0x0b, 0x00, 0x0d, 0xd8, 0x0a, 0xa8, 0x05,
+ 0xa8, 0xfe, 0x28, 0xf8, 0x28, 0xf4, 0x90, 0xf3, 0x98, 0xf6, 0x50, 0xfc, 0x78, 0x03, 0x80, 0x09,
+ 0x98, 0x0c, 0x70, 0x0b, 0xd8, 0x06, 0x48, 0x00, 0xe0, 0xf8, 0x70, 0xf3, 0xb8, 0xf1, 0xc8, 0xf4,
+ 0xf8, 0xfa, 0x68, 0x02, 0x50, 0x0a, 0x40, 0x0f, 0xa8, 0x0f, 0x98, 0x0b, 0x80, 0x04, 0x50, 0xfc,
+ 0x88, 0xf4, 0x40, 0xf0, 0xc8, 0xf0, 0x30, 0xf5, 0x78, 0xfc, 0xa8, 0x04, 0x00, 0x0c, 0xa8, 0x0f,
+ 0x98, 0x0e, 0xa8, 0x08, 0x30, 0x00, 0xc0, 0xf7, 0x80, 0xf1, 0x80, 0xef, 0x58, 0xf2, 0x20, 0xf9,
+ 0xb0, 0x01, 0x90, 0x09, 0x68, 0x0f, 0xc0, 0x10, 0x20, 0x0d, 0x30, 0x05, 0xd8, 0xfb, 0xf0, 0xf3,
+ 0x98, 0xef, 0x20, 0xf0, 0x58, 0xf5, 0xb8, 0xfd, 0x90, 0x06, 0x58, 0x0d, 0x58, 0x10, 0x90, 0x0e,
+ 0x88, 0x08, 0xe8, 0xff, 0x78, 0xf7, 0xb8, 0xf1, 0xa0, 0xef, 0x40, 0xf2, 0xd8, 0xf8, 0x80, 0x02,
+ 0x60, 0x0b, 0xc0, 0x10, 0xa0, 0x11, 0x78, 0x0d, 0x70, 0x05, 0x30, 0xfb, 0x98, 0xf2, 0x20, 0xee,
+ 0x28, 0xef, 0x20, 0xf5, 0x48, 0xfe, 0xf8, 0x07, 0x28, 0x0f, 0xd0, 0x11, 0x18, 0x0e, 0x18, 0x06,
};
static inline struct ast_frame *slin8_sample(void)