aboutsummaryrefslogtreecommitdiffstats
path: root/main/asterisk/ASTERISK-18995.patch
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2014-10-31 10:48:26 +0200
committerTimo Teräs <timo.teras@iki.fi>2014-10-31 10:50:31 +0200
commit538699c853816755c66c15f39f5d783005e1480a (patch)
treed9d076b8e15b1dd592b7f048fc1a5a7dcff34281 /main/asterisk/ASTERISK-18995.patch
parent1e50aa00c309d65fcaafd9f2491492cb3766780a (diff)
downloadaports-538699c853816755c66c15f39f5d783005e1480a.tar.bz2
aports-538699c853816755c66c15f39f5d783005e1480a.tar.xz
main/asterisk: upgrade to 13.0.0
Diffstat (limited to 'main/asterisk/ASTERISK-18995.patch')
-rw-r--r--main/asterisk/ASTERISK-18995.patch49
1 files changed, 15 insertions, 34 deletions
diff --git a/main/asterisk/ASTERISK-18995.patch b/main/asterisk/ASTERISK-18995.patch
index cd144847be..2613176305 100644
--- a/main/asterisk/ASTERISK-18995.patch
+++ b/main/asterisk/ASTERISK-18995.patch
@@ -1,10 +1,10 @@
---- /dev/null 2011-11-29 09:02:40.279581283 +0200
-+++ b/formats/format_ogg_speex.c 2011-12-08 15:57:12.000000000 +0200
-@@ -0,0 +1,355 @@
+--- /dev/null 2014-10-31 08:01:35.193329595 -0200
++++ asterisk-13.0.0/formats/format_ogg_speex.c 2014-10-31 09:19:34.010493106 -0200
+@@ -0,0 +1,336 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
-+ * Copyright (C) 2011, Timo Teräs
++ * Copyright (C) 2011-2014, Timo Teräs
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
@@ -36,6 +36,7 @@
+
+#include "asterisk/mod_format.h"
+#include "asterisk/module.h"
++#include "asterisk/format_cache.h"
+
+#include <speex/speex_header.h>
+#include <ogg/ogg.h>
@@ -50,7 +51,6 @@
+ ogg_page og;
+ ogg_packet op;
+
-+ int format_id;
+ int serialno;
+
+ /*! \brief Indicates whether an End of Stream condition has been detected. */
@@ -124,18 +124,17 @@
+/*!
+ * \brief Create a new OGG/Speex filestream and set it up for reading.
+ * \param fs File that points to on disk storage of the OGG/Speex data.
-+ * \param expected_rate The expected Speex format (sampling rate).
+ * \return The new filestream.
+ */
-+static int ogg_speex_open(struct ast_filestream *fs, int format_id, int expected_rate)
++static int ogg_speex_open(struct ast_filestream *fs)
+{
+ char *buffer;
+ size_t bytes;
+ struct speex_desc *s = (struct speex_desc *)fs->_private;
+ SpeexHeader *hdr = NULL;
-+ int i, result;
++ int i, result, expected_rate;
+
-+ s->format_id = format_id;
++ expected_rate = ast_format_get_sample_rate(fs->fmt->format);
+ s->serialno = -1;
+ ogg_sync_init(&s->oy);
+
@@ -232,13 +231,10 @@
+ if (read_packet(fs) < 0)
+ return NULL;
+
-+ fs->fr.frametype = AST_FRAME_VOICE;
-+ ast_format_set(&fs->fr.subclass.format, s->format_id, 0);
-+ fs->fr.mallocd = 0;
+ AST_FRAME_SET_BUFFER(&fs->fr, fs->buf, AST_FRIENDLY_OFFSET, BUF_SIZE);
+ memcpy(fs->fr.data.ptr, s->op.packet, s->op.bytes);
+ fs->fr.datalen = s->op.bytes;
-+ fs->fr.samples = *whennext = ast_codec_get_samples(&fs->fr);
++ fs->fr.samples = *whennext = ast_codec_samples_count(&fs->fr);
+
+ return &fs->fr;
+}
@@ -274,15 +270,10 @@
+ return -1;
+}
+
-+static int ogg_speex_open_nb(struct ast_filestream *fs)
-+{
-+ return ogg_speex_open(fs, AST_FORMAT_SPEEX, 8000);
-+}
-+
+static struct ast_format_def speex_f = {
+ .name = "ogg_speex",
+ .exts = "spx",
-+ .open = ogg_speex_open_nb,
++ .open = ogg_speex_open,
+ .seek = ogg_speex_seek,
+ .trunc = ogg_speex_trunc,
+ .tell = ogg_speex_tell,
@@ -292,15 +283,10 @@
+ .desc_size = sizeof(struct speex_desc),
+};
+
-+static int ogg_speex_open_wb(struct ast_filestream *fs)
-+{
-+ return ogg_speex_open(fs, AST_FORMAT_SPEEX16, 16000);
-+}
-+
+static struct ast_format_def speex16_f = {
+ .name = "ogg_speex16",
+ .exts = "spx16",
-+ .open = ogg_speex_open_wb,
++ .open = ogg_speex_open,
+ .seek = ogg_speex_seek,
+ .trunc = ogg_speex_trunc,
+ .tell = ogg_speex_tell,
@@ -310,15 +296,10 @@
+ .desc_size = sizeof(struct speex_desc),
+};
+
-+static int ogg_speex_open_uwb(struct ast_filestream *fs)
-+{
-+ return ogg_speex_open(fs, AST_FORMAT_SPEEX32, 32000);
-+}
-+
+static struct ast_format_def speex32_f = {
+ .name = "ogg_speex32",
+ .exts = "spx32",
-+ .open = ogg_speex_open_uwb,
++ .open = ogg_speex_open,
+ .seek = ogg_speex_seek,
+ .trunc = ogg_speex_trunc,
+ .tell = ogg_speex_tell,
@@ -330,9 +311,9 @@
+
+static int load_module(void)
+{
-+ ast_format_set(&speex_f.format, AST_FORMAT_SPEEX, 0);
-+ ast_format_set(&speex16_f.format, AST_FORMAT_SPEEX16, 0);
-+ ast_format_set(&speex32_f.format, AST_FORMAT_SPEEX32, 0);
++ speex_f.format = ast_format_speex;
++ speex16_f.format = ast_format_speex16;
++ speex32_f.format = ast_format_speex32;
+
+ if (ast_format_def_register(&speex_f) ||
+ ast_format_def_register(&speex16_f) ||