summaryrefslogtreecommitdiff
path: root/main/translate.c
diff options
context:
space:
mode:
authorKevin Harwell <kharwell@digium.com>2016-07-13 17:45:27 -0500
committerKevin Harwell <kharwell@digium.com>2016-07-13 17:45:27 -0500
commit63ac4c9487ee085755c991813ec7e5994bf7ccc2 (patch)
tree883757ca9ea7faeb3d7dc184d42b64f88be3bdec /main/translate.c
parente0f27ecabb2ff766ea4ec7bdd77fccab2fe826c4 (diff)
translate: explicit format destination not properly set
If the destination format's name differed from the codec name then the translator's explict_dst field would be improperly set. In some circumstances it would end up setting it to a newly created format that has the same name as the codec when it actually needed to be the given destination codec. This could cause the translation path to use the wrong format. For instance, if an endpoint had specified 'myulaw' as a format the translator could end up using a 'ulaw' format (with whatever/default settings) instead. If the format attribute settings differed between the two then there may unexpected results during processing. This patch removes the name check when building the translation path. This should make it always set the translator's explicit_dst to the given destination format as long as the sample rate and types match. Change-Id: Iaf8a03831d68e657d89569d54b505074efbefab5
Diffstat (limited to 'main/translate.c')
-rw-r--r--main/translate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/translate.c b/main/translate.c
index 8d37e3724..43e6e29bd 100644
--- a/main/translate.c
+++ b/main/translate.c
@@ -494,7 +494,7 @@ struct ast_trans_pvt *ast_translator_build_path(struct ast_format *dst, struct a
AST_RWLIST_UNLOCK(&translators);
return NULL;
}
- if ((t->dst_codec.sample_rate == ast_format_get_sample_rate(dst)) && (t->dst_codec.type == ast_format_get_type(dst)) && (!strcmp(t->dst_codec.name, ast_format_get_name(dst)))) {
+ if ((t->dst_codec.sample_rate == ast_format_get_sample_rate(dst)) && (t->dst_codec.type == ast_format_get_type(dst))) {
explicit_dst = dst;
}
if (!(cur = newpvt(t, explicit_dst))) {