]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
tweak the v21 detector to detect an additional pattern of hits and misses
authorMatthew Nicholson <mnicholson@digium.com>
Thu, 27 Oct 2011 20:10:12 +0000 (20:10 +0000)
committerMatthew Nicholson <mnicholson@digium.com>
Thu, 27 Oct 2011 20:10:12 +0000 (20:10 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@342605 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/dsp.c

index 7ce4bf0c864d32e1eff1012026fa5a1358fce662..53172d925a7fa4b7dadb544a41271b4d3f5514c9 100644 (file)
@@ -629,7 +629,7 @@ static int v21_detect(struct ast_dsp *dsp, v21_detect_state_t *s, int16_t *amp,
                }
 
                if (hit) {
-                       if (s->miss_count == 3) {
+                       if (s->miss_count == 3 || (s->hit_count == 1 && s->miss_count == 2)) {
                                s->hit_count++;
                        } else {
                                s->hit_count = 1;