summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/codec_builtin.c19
-rw-r--r--main/format.c8
2 files changed, 17 insertions, 10 deletions
diff --git a/main/codec_builtin.c b/main/codec_builtin.c
index da03cce6b..5fdfa7e12 100644
--- a/main/codec_builtin.c
+++ b/main/codec_builtin.c
@@ -37,6 +37,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/format.h"
#include "asterisk/format_cache.h"
#include "asterisk/frame.h"
+#include "asterisk/smoother.h"
int __ast_codec_register_with_format(struct ast_codec *codec, const char *format_name,
struct ast_module *mod);
@@ -264,7 +265,7 @@ static struct ast_codec slin8 = {
.minimum_bytes = 160,
.samples_count = slin_samples,
.get_length = slin_length,
- .smooth = 1,
+ .smooth = AST_SMOOTHER_FLAGS_PACK(AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED),
};
static struct ast_codec slin12 = {
@@ -278,7 +279,7 @@ static struct ast_codec slin12 = {
.minimum_bytes = 240,
.samples_count = slin_samples,
.get_length = slin_length,
- .smooth = 1,
+ .smooth = AST_SMOOTHER_FLAGS_PACK(AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED),
};
static struct ast_codec slin16 = {
@@ -292,7 +293,7 @@ static struct ast_codec slin16 = {
.minimum_bytes = 320,
.samples_count = slin_samples,
.get_length = slin_length,
- .smooth = 1,
+ .smooth = AST_SMOOTHER_FLAGS_PACK(AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED),
};
static struct ast_codec slin24 = {
@@ -306,7 +307,7 @@ static struct ast_codec slin24 = {
.minimum_bytes = 480,
.samples_count = slin_samples,
.get_length = slin_length,
- .smooth = 1,
+ .smooth = AST_SMOOTHER_FLAGS_PACK(AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED),
};
static struct ast_codec slin32 = {
@@ -320,7 +321,7 @@ static struct ast_codec slin32 = {
.minimum_bytes = 640,
.samples_count = slin_samples,
.get_length = slin_length,
- .smooth = 1,
+ .smooth = AST_SMOOTHER_FLAGS_PACK(AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED),
};
static struct ast_codec slin44 = {
@@ -334,7 +335,7 @@ static struct ast_codec slin44 = {
.minimum_bytes = 882,
.samples_count = slin_samples,
.get_length = slin_length,
- .smooth = 1,
+ .smooth = AST_SMOOTHER_FLAGS_PACK(AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED),
};
static struct ast_codec slin48 = {
@@ -348,7 +349,7 @@ static struct ast_codec slin48 = {
.minimum_bytes = 960,
.samples_count = slin_samples,
.get_length = slin_length,
- .smooth = 1,
+ .smooth = AST_SMOOTHER_FLAGS_PACK(AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED),
};
static struct ast_codec slin96 = {
@@ -362,7 +363,7 @@ static struct ast_codec slin96 = {
.minimum_bytes = 1920,
.samples_count = slin_samples,
.get_length = slin_length,
- .smooth = 1,
+ .smooth = AST_SMOOTHER_FLAGS_PACK(AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED),
};
static struct ast_codec slin192 = {
@@ -376,7 +377,7 @@ static struct ast_codec slin192 = {
.minimum_bytes = 3840,
.samples_count = slin_samples,
.get_length = slin_length,
- .smooth = 1,
+ .smooth = AST_SMOOTHER_FLAGS_PACK(AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED),
};
static int lpc10_samples(struct ast_frame *frame)
diff --git a/main/format.c b/main/format.c
index 5bf38dfb2..758a7fc5e 100644
--- a/main/format.c
+++ b/main/format.c
@@ -377,7 +377,13 @@ const char *ast_format_get_codec_name(const struct ast_format *format)
int ast_format_can_be_smoothed(const struct ast_format *format)
{
- return format->codec->smooth;
+ /* Coalesce to 1 if non-zero */
+ return format->codec->smooth ? 1 : 0;
+}
+
+int ast_format_get_smoother_flags(const struct ast_format *format)
+{
+ return AST_SMOOTHER_FLAGS_UNPACK(format->codec->smooth);
}
enum ast_media_type ast_format_get_type(const struct ast_format *format)