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 committed 2007-01-29 15:43:41 +00:00
1 parent fcb152104f
commit db70ef2a37
5 files changed
+332 -59

No files matched your search

+15
View File
@@ -782,6 +782,19 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_init(switch_codec_t *codec, ch
return SWITCH_STATUS_GENERR;
}
/* If no specific codec interval is requested opt for 20ms above all else because lots of stuff assumes it */
if (!ms) {
for (iptr = codec_interface->implementations; iptr; iptr = iptr->next) {
if ((!rate || rate == iptr->samples_per_second) &&
(20 == (iptr->microseconds_per_frame / 1000)) &&
(!channels || channels == iptr->number_of_channels)) {
implementation = iptr;
goto found;
}
}
}
/* Either looking for a specific interval or there was no interval specified and there wasn't one @20ms available*/
for (iptr = codec_interface->implementations; iptr; iptr = iptr->next) {
if ((!rate || rate == iptr->samples_per_second) &&
(!ms || ms == (iptr->microseconds_per_frame / 1000)) &&
@@ -791,6 +804,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_init(switch_codec_t *codec, ch
}
}
found:
if (implementation) {
switch_status_t status;
codec->codec_interface = codec_interface;