aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-09-22 12:15:00 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-09-22 12:15:00 +0000
commit1eb95f1cfeeab53cf933389c350210dfcfecf63c (patch)
tree572573b92cb117d00c1d0df1f1c62b376cd49376
parentde60feae86c732afa8ffbdc4b9fb6d2dcabb0b46 (diff)
Check to be sure # of samples is > 0...
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3818 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xapps/app_test.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/app_test.c b/apps/app_test.c
index 90af93c77..3743b6771 100755
--- a/apps/app_test.c
+++ b/apps/app_test.c
@@ -88,6 +88,10 @@ static int measurenoise(struct ast_channel *chan, int ms, char *who)
}
if (res < 0)
return res;
+ if (!samples) {
+ ast_log(LOG_NOTICE, "No samples were received from the other side!\n");
+ return -1;
+ }
ast_log(LOG_DEBUG, "%s: Noise: %d, samples: %d, avg: %d\n", who, noise, samples, noise / samples);
return (noise / samples);
}