diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-05-25 13:26:52 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-05-25 13:26:52 +0000 |
commit | 603a5334ddad6388646b16b203f2c7316dd52fd9 (patch) | |
tree | d70a7f59273eff711071d27736cf718ac574424e /main/slinfactory.c | |
parent | 578296fb225ec822cae93ef2a3d2027dcb6587c2 (diff) |
Minor tweak... drop translation path if one exists when we get an already signed linear frame in. Chances are the stream has then switched to signed linear and we no longer need the path.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@66126 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/slinfactory.c')
-rw-r--r-- | main/slinfactory.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/main/slinfactory.c b/main/slinfactory.c index 5061a609e..a42b2b213 100644 --- a/main/slinfactory.c +++ b/main/slinfactory.c @@ -65,16 +65,19 @@ int ast_slinfactory_feed(struct ast_slinfactory *sf, struct ast_frame *f) sf->trans = NULL; } if (!sf->trans) { - if ((sf->trans = ast_translator_build_path(AST_FORMAT_SLINEAR, f->subclass)) == NULL) { + if (!(sf->trans = ast_translator_build_path(AST_FORMAT_SLINEAR, f->subclass))) { ast_log(LOG_WARNING, "Cannot build a path from %s to slin\n", ast_getformatname(f->subclass)); return 0; - } else { - sf->format = f->subclass; } + sf->format = f->subclass; } if (!(begin_frame = ast_translate(sf->trans, f, 0)) || !(duped_frame = ast_frdup(begin_frame))) return 0; } else { + if (sf->trans) { + ast_translator_free_path(sf->trans); + sf->trans = NULL; + } if (!(duped_frame = ast_frdup(f))) return 0; } |