summaryrefslogtreecommitdiff
path: root/apps/app_test.c
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2004-09-22 12:15:00 +0000
committerMark Spencer <markster@digium.com>2004-09-22 12:15:00 +0000
commite0f335a4eb1df9a3b48673f0d22fe416af30a5f4 (patch)
tree572573b92cb117d00c1d0df1f1c62b376cd49376 /apps/app_test.c
parent78531a0f32e5d3357226b8083f053e2d397d32fd (diff)
Check to be sure # of samples is > 0...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3818 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_test.c')
-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);
}