diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-09-22 12:15:00 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-09-22 12:15:00 +0000 |
commit | 1eb95f1cfeeab53cf933389c350210dfcfecf63c (patch) | |
tree | 572573b92cb117d00c1d0df1f1c62b376cd49376 /apps/app_test.c | |
parent | de60feae86c732afa8ffbdc4b9fb6d2dcabb0b46 (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
Diffstat (limited to 'apps/app_test.c')
-rwxr-xr-x | apps/app_test.c | 4 |
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); } |