]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add L16 def for 32ms and allow timer matrix to drop to 1ms to support nelly
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 12 Apr 2011 14:47:11 +0000 (09:47 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 12 Apr 2011 14:47:11 +0000 (09:47 -0500)
src/mod/applications/mod_commands/mod_commands.c
src/switch_pcm.c
src/switch_time.c

index ab402db8f5529b7710e83590c78bcc7aff96a246..501b3f88b220e15fcc664fb7a42e5330ecb6b3c3 100644 (file)
@@ -520,7 +520,7 @@ SWITCH_STANDARD_API(timer_test_function)
                timer_name = argv[2];
        }
 
-       if (mss != 10 && mss != 20 && mss != 30 && mss != 40 && mss != 60 && mss != 120) {
+       if (mss != 10 && mss != 20 && mss != 30 && mss != 32 && mss != 40 && mss != 60 && mss != 120) {
                stream->write_function(stream, "parameter missing: %s\n", TIMER_TEST_SYNTAX);
                goto end;
        }
index d7ae48a28e6f771242d4ab53426aefe54029905f..51d1ced182693450d7faf5c8d165dafcd04aa42c 100644 (file)
@@ -627,6 +627,25 @@ SWITCH_MODULE_LOAD_FUNCTION(core_pcm_load)
                                                                                 switch_raw_destroy);   /* deinitalize a codec handle using this implementation */
 
 
+       switch_core_codec_add_implementation(pool, codec_interface, SWITCH_CODEC_TYPE_AUDIO,    /* enumeration defining the type of the codec */
+                                                                                70,    /* the IANA code number */
+                                                                                "L16", /* the IANA code name */
+                                                                                NULL,  /* default fmtp to send (can be overridden by the init function) */
+                                                                                11025, /* samples transferred per second */
+                                                                                11025, /* actual samples transferred per second */
+                                                                                176400,        /* bits transferred per second */
+                                                                                32000, /* number of microseconds per frame */
+                                                                                256,   /* number of samples per frame */
+                                                                                512,   /* number of bytes per frame decompressed */
+                                                                                512,   /* number of bytes per frame compressed */
+                                                                                1,     /* number of channels represented */
+                                                                                1,     /* number of frames per network packet */
+                                                                                switch_raw_init,       /* function to initialize a codec handle using this implementation */
+                                                                                switch_raw_encode,     /* function to encode raw data into encoded data */
+                                                                                switch_raw_decode,     /* function to decode encoded data into raw data */
+                                                                                switch_raw_destroy);   /* deinitalize a codec handle using this implementation */
+
+
 
        /* indicate that the module should continue to be loaded */
 
index 70972a660bd94b250dbaa20d471ee20293a410c1..0fd7d9ee49be21b6399fa4b70f9f49e5341e0214 100644 (file)
@@ -502,8 +502,9 @@ static switch_status_t timer_init(switch_timer_t *timer)
                private_info->roll = TIMER_MATRIX[timer->interval].roll;
                private_info->ready = 1;
 
-               if (timer->interval > 0 && timer->interval < MS_PER_TICK) {
-                       MS_PER_TICK = timer->interval;
+               if (timer->interval > 0 && (timer->interval < MS_PER_TICK || (timer->interval % 10) != 0)) {
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Increasing global timer resolution to 1ms to handle interval %d\n", timer->interval);
+                       MS_PER_TICK = 1;
                        switch_time_sync();
                }