codec tweaks (do a make sure)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4077 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2007-01-29 15:43:41 +00:00
parent fcb152104f
commit db70ef2a37
5 changed files with 332 additions and 59 deletions

View File

@@ -758,6 +758,27 @@ SWITCH_DECLARE(int) switch_loadable_module_get_codecs_sorted(const switch_codec_
}
if ((codec_interface = switch_loadable_module_get_codec_interface(name)) != 0 ) {
/* If no specific codec interval is requested opt for 20ms above all else because lots of stuff assumes it */
if (!interval) {
for (imp = codec_interface->implementations; imp; imp = imp->next) {
uint8_t match = 1;
if ((uint32_t)(imp->microseconds_per_frame / 1000) != 20) {
match = 0;
}
if (match && rate && (uint32_t)imp->samples_per_second != rate) {
match = 0;
}
if (match) {
array[i++] = imp;
goto found;
}
}
}
/* Either looking for a specific interval or there was no interval specified and there wasn't one @20ms available*/
for (imp = codec_interface->implementations; imp; imp = imp->next) {
uint8_t match = 1;
@@ -771,8 +792,12 @@ SWITCH_DECLARE(int) switch_loadable_module_get_codecs_sorted(const switch_codec_
if (match) {
array[i++] = imp;
goto found;
}
}
found:
if (i > arraylen) {
break;
}