Fix 2nd harmonic on MF
[asterisk/asterisk.git] / dsp.c
diff --git a/dsp.c b/dsp.c
index afcb3fd..6af5d30 100755 (executable)
--- a/dsp.c
+++ b/dsp.c
@@ -718,7 +718,7 @@ static int mf_detect (mf_detect_state_t *s,
                        /* Check for 2nd harmonic */
                        if (goertzel_result(&s->tone_out2nd[best1]) * MF_2ND_HARMONIC > tone_energy[best1]) 
                                sofarsogood = 0;
                        /* Check for 2nd harmonic */
                        if (goertzel_result(&s->tone_out2nd[best1]) * MF_2ND_HARMONIC > tone_energy[best1]) 
                                sofarsogood = 0;
-                       else if (goertzel_result(&s->tone_out2nd[best1]) * MF_2ND_HARMONIC > tone_energy[best2])
+                       else if (goertzel_result(&s->tone_out2nd[best2]) * MF_2ND_HARMONIC > tone_energy[best2])
                                sofarsogood = 0;
                }
                if (sofarsogood) {
                                sofarsogood = 0;
                }
                if (sofarsogood) {