From: Joshua Colp Date: Fri, 25 May 2007 13:26:52 +0000 (+0000) Subject: Minor tweak... drop translation path if one exists when we get an already signed... X-Git-Tag: 1.6.0-beta1~3^2~2574 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f65934a517d9d5109d3c049fd48a34b6d40fdf2a;p=thirdparty%2Fasterisk.git 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: https://origsvn.digium.com/svn/asterisk/trunk@66126 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/slinfactory.c b/main/slinfactory.c index 5061a609e2..a42b2b2133 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; }