mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 17:38:59 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user