]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
tweaks to codec buffer size detection
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 14 Jul 2011 05:14:10 +0000 (00:14 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 14 Jul 2011 05:14:10 +0000 (00:14 -0500)
src/include/private/switch_core_pvt.h
src/include/switch_loadable_module.h
src/switch_loadable_module.c

index 6115e70edef05e73c4a0c99a447c3868fae0239e..423969fac84f9ea81c60390388fc658091083e83 100644 (file)
@@ -84,7 +84,6 @@
 
 #define SWITCH_EVENT_QUEUE_LEN 256
 #define SWITCH_MESSAGE_QUEUE_LEN 256
-#define SWITCH_SQL_QUEUE_LEN 100000
 
 #define SWITCH_BUFFER_BLOCK_FRAMES 25
 #define SWITCH_BUFFER_START_FRAMES 50
index 7e4d6172567a469713e8050b098856422610696e..4b81a1f25e1881193b0090e0fc7104b80bc593d7 100644 (file)
@@ -438,7 +438,11 @@ static inline void switch_core_codec_add_implementation(switch_memory_pool_t *po
                                                                                                                /*! deinitalize a codec handle using this implementation */
                                                                                                                switch_core_codec_destroy_func_t destroy)
 {
-       if (codec_type == SWITCH_CODEC_TYPE_VIDEO || switch_check_interval(actual_samples_per_second, microseconds_per_packet / 1000)) {
+
+       if (decoded_bytes_per_packet > SWITCH_RECOMMENDED_BUFFER_SIZE) {
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Rejected codec name: %s rate: %u ptime: %u not enough buffer space %d > %d\n",
+                                                 iananame, actual_samples_per_second, microseconds_per_packet / 1000, decoded_bytes_per_packet, SWITCH_RECOMMENDED_BUFFER_SIZE);
+       } else if (codec_type == SWITCH_CODEC_TYPE_VIDEO || switch_check_interval(actual_samples_per_second, microseconds_per_packet / 1000)) {
                switch_codec_implementation_t *impl = (switch_codec_implementation_t *) switch_core_alloc(pool, sizeof(*impl));
                impl->codec_type = codec_type;
                impl->ianacode = ianacode;
index db4f4fa1ddc1b5a8e3569ec7c818764e00cb2cc7..8fca52eb5812b15e67e00cbd45192666ae06cb27 100644 (file)
@@ -175,8 +175,9 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable
                                        if (impl->decoded_bytes_per_packet > SWITCH_RECOMMENDED_BUFFER_SIZE) {
                                                load_interface = 0;
                                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT,
-                                                                                 "Failed to load codec interface %s from %s due to bytes per frame exceeding buffer size.\n", ptr->interface_name,
-                                                                                 key);
+                                                                                 "Failed to load codec interface %s from %s due to bytes per frame %d exceeding buffer size %d.\n", 
+                                                                                 ptr->interface_name,
+                                                                                 key, impl->decoded_bytes_per_packet, SWITCH_RECOMMENDED_BUFFER_SIZE);
                                                break;
                                        }
                                }