]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
clean up tone_detect
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 11 Feb 2009 00:17:17 +0000 (00:17 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 11 Feb 2009 00:17:17 +0000 (00:17 +0000)
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@661 a93c3328-9c30-0410-af19-c9cd2b2d52af

libs/freetdm/src/libteletone_detect.c

index c85ac591610cacfae7c75808ff04c9c48e2f6bf5..79875a0ade44b5c842327f03ce179f2cfdac1db5 100644 (file)
@@ -141,10 +141,16 @@ void teletone_multi_tone_init(teletone_multi_tone_t *mt, teletone_tone_map_t *ma
        float theta = 0;
        int x = 0;
 
+       if (!mt->sample_rate) {
+               mt->sample_rate = 8000;
+       }
+
        if(!mt->min_samples) {
                mt->min_samples = 102;
        }
 
+       mt->min_samples *= (mt->sample_rate / 8000);
+
        if (!mt->positive_factor) {
                mt->positive_factor = 2;
        }
@@ -157,10 +163,6 @@ void teletone_multi_tone_init(teletone_multi_tone_t *mt, teletone_tone_map_t *ma
                mt->hit_factor = 2;
        }
 
-       if (!mt->sample_rate) {
-               mt->sample_rate = 8000;
-       }
-
        for(x = 0; x < TELETONE_MAX_TONES; x++) {
                if ((int) map->freqs[x] == 0) {
                        break;