aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-27 02:43:49 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-27 02:43:49 +0000
commitd50957552268bf92841436956c99020e8d2e19fe (patch)
tree9d1857d2cda82631945a32e39cc09764a8e082ef
parent625c87d9440b8e139bee36efe7112038c664253a (diff)
don't do useless translation destroy/build when the channel is already in the correct format
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@38310 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channel.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/channel.c b/channel.c
index dc33e8a57..a80960e70 100644
--- a/channel.c
+++ b/channel.c
@@ -2328,6 +2328,10 @@ static int set_format(struct ast_channel *chan, int fmt, int *rawformat, int *fo
int native;
int res;
+ /* if already in the desired format nothing to do here */
+ if (*format == fmt)
+ return 0;
+
native = chan->nativeformats;
/* Find a translation path from the native format to one of the desired formats */
if (!direction)