diff --git a/src/include/private/switch_core_pvt.h b/src/include/private/switch_core_pvt.h index 6115e70ede..423969fac8 100644 --- a/src/include/private/switch_core_pvt.h +++ b/src/include/private/switch_core_pvt.h @@ -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 diff --git a/src/include/switch_loadable_module.h b/src/include/switch_loadable_module.h index 7e4d617256..4b81a1f25e 100644 --- a/src/include/switch_loadable_module.h +++ b/src/include/switch_loadable_module.h @@ -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; diff --git a/src/switch_loadable_module.c b/src/switch_loadable_module.c index db4f4fa1dd..8fca52eb58 100644 --- a/src/switch_loadable_module.c +++ b/src/switch_loadable_module.c @@ -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; } }