]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
tune the v21 preamble detector to properly detect the desired sequence of hits
authorMatthew Nicholson <mnicholson@digium.com>
Thu, 14 Jul 2011 17:46:32 +0000 (17:46 +0000)
committerMatthew Nicholson <mnicholson@digium.com>
Thu, 14 Jul 2011 17:46:32 +0000 (17:46 +0000)
and misses

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.10@328162 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/dsp.c

index 02cdc9d73c26bac432ec068b9af8ce0fc920d9ac..da982d0c14e2a968ab164674f3bd73fa0c5eb43f 100644 (file)
@@ -624,10 +624,10 @@ static int v21_detect(struct ast_dsp *dsp, v21_detect_state_t *s, int16_t *amp,
                }
 
                if (hit) {
-                       if (s->hit_count == 0 || s->miss_count == 3) {
+                       if (s->miss_count == 3) {
                                s->hit_count++;
                        } else {
-                               s->hit_count = 0;
+                               s->hit_count = 1;
                        }
 
                        s->miss_count = 0;