]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
more tweaks
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 29 Jan 2007 18:31:35 +0000 (18:31 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 29 Jan 2007 18:31:35 +0000 (18:31 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4084 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_loadable_module.c

index cdf3079a74de2e87412f47dcc9901f6d08b54b62..a77805634ddcbfab57e83d71e12de451c3f83c9f 100644 (file)
@@ -711,11 +711,23 @@ SWITCH_DECLARE(int) switch_loadable_module_get_codecs(switch_memory_pool_t *pool
        void *val;
        switch_codec_interface_t *codec_interface;
        int i = 0;
+    const switch_codec_implementation_t *imp;
 
        for (hi = switch_hash_first(pool, loadable_modules.codec_hash); hi; hi = switch_hash_next(hi)) {
                switch_hash_this(hi, NULL, NULL, &val);
                codec_interface = (switch_codec_interface_t *) val;
+        /* Look for a 20ms implementation because it's the safest choice */
+        for (imp = codec_interface->implementations; imp; imp = imp->next) {
+            if (imp->microseconds_per_frame / 1000 == 20) {
+                array[i++] = imp;
+                goto found;
+            }
+        }
+        /* oh well we will use what we have */
                array[i++] = codec_interface->implementations;
+
+    found:
+
                if (i > arraylen) {
                        break;
                }