sigh more stupidness
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5287 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
7300c50352
commit
0bac27dd2f
|
@ -88,7 +88,7 @@ static switch_status_t switch_raw_destroy(switch_codec_t *codec)
|
|||
|
||||
static const switch_codec_implementation_t raw_32k_60ms_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 10,
|
||||
/*.ianacode */ 119,
|
||||
/*.iananame */ "L16",
|
||||
/*.fmtp */ NULL,
|
||||
/*.samples_per_second = */ 32000,
|
||||
|
@ -109,7 +109,7 @@ static const switch_codec_implementation_t raw_32k_60ms_implementation = {
|
|||
|
||||
static const switch_codec_implementation_t raw_32k_30ms_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 10,
|
||||
/*.ianacode */ 119,
|
||||
/*.iananame */ "L16",
|
||||
/*.fmtp */ NULL,
|
||||
/*.samples_per_second = */ 32000,
|
||||
|
@ -130,7 +130,7 @@ static const switch_codec_implementation_t raw_32k_30ms_implementation = {
|
|||
|
||||
static const switch_codec_implementation_t raw_32k_20ms_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 10,
|
||||
/*.ianacode */ 119,
|
||||
/*.iananame */ "L16",
|
||||
/*.fmtp */ NULL,
|
||||
/*.samples_per_second = */ 32000,
|
||||
|
@ -151,7 +151,7 @@ static const switch_codec_implementation_t raw_32k_20ms_implementation = {
|
|||
|
||||
static const switch_codec_implementation_t raw_32k_10ms_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 10,
|
||||
/*.ianacode */ 119,
|
||||
/*.iananame */ "L16",
|
||||
/*.fmtp */ NULL,
|
||||
/*.samples_per_second = */ 32000,
|
||||
|
@ -172,7 +172,7 @@ static const switch_codec_implementation_t raw_32k_10ms_implementation = {
|
|||
|
||||
static const switch_codec_implementation_t raw_22k_20ms_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 10,
|
||||
/*.ianacode */ 118,
|
||||
/*.iananame */ "L16",
|
||||
/*.fmtp */ NULL,
|
||||
/*.samples_per_second = */ 22050,
|
||||
|
@ -193,7 +193,7 @@ static const switch_codec_implementation_t raw_22k_20ms_implementation = {
|
|||
|
||||
static const switch_codec_implementation_t raw_16k_120ms_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 10,
|
||||
/*.ianacode */ 117,
|
||||
/*.iananame */ "L16",
|
||||
/*.fmtp */ NULL,
|
||||
/*.samples_per_second */ 8000,
|
||||
|
@ -214,7 +214,7 @@ static const switch_codec_implementation_t raw_16k_120ms_implementation = {
|
|||
|
||||
static const switch_codec_implementation_t raw_16k_60ms_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 10,
|
||||
/*.ianacode */ 117,
|
||||
/*.iananame */ "L16",
|
||||
/*.fmtp */ NULL,
|
||||
/*.samples_per_second */ 16000,
|
||||
|
@ -235,7 +235,7 @@ static const switch_codec_implementation_t raw_16k_60ms_implementation = {
|
|||
|
||||
static const switch_codec_implementation_t raw_16k_30ms_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 10,
|
||||
/*.ianacode */ 117,
|
||||
/*.iananame */ "L16",
|
||||
/*.fmtp */ NULL,
|
||||
/*.samples_per_second */ 16000,
|
||||
|
@ -256,7 +256,7 @@ static const switch_codec_implementation_t raw_16k_30ms_implementation = {
|
|||
|
||||
static const switch_codec_implementation_t raw_16k_20ms_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 10,
|
||||
/*.ianacode */ 117,
|
||||
/*.iananame */ "L16",
|
||||
/*.fmtp */ NULL,
|
||||
/*.samples_per_second = */ 16000,
|
||||
|
@ -277,7 +277,7 @@ static const switch_codec_implementation_t raw_16k_20ms_implementation = {
|
|||
|
||||
static const switch_codec_implementation_t raw_16k_10ms_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 10,
|
||||
/*.ianacode */ 117,
|
||||
/*.iananame */ "L16",
|
||||
/*.fmtp */ NULL,
|
||||
/*.samples_per_second = */ 16000,
|
||||
|
|
|
@ -1145,19 +1145,24 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t *
|
|||
|
||||
for (i = 0; i < tech_pvt->num_codecs; i++) {
|
||||
const switch_codec_implementation_t *imp = tech_pvt->codecs[i];
|
||||
|
||||
uint32_t codec_rate = imp->samples_per_second;
|
||||
if (imp->codec_type != SWITCH_CODEC_TYPE_AUDIO) {
|
||||
continue;
|
||||
}
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Audio Codec Compare [%s:%d]/[%s:%d]\n",
|
||||
rm_encoding, map->rm_pt, imp->iananame, imp->ianacode);
|
||||
|
||||
if (map->rm_pt == 9) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Oh sure! You say 8000, but you mean 16000! This is, of course, stupid!\n");
|
||||
codec_rate = 16000;
|
||||
}
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Audio Codec Compare [%s:%d:%u]/[%s:%d:%u]\n",
|
||||
rm_encoding, map->rm_pt, (int)map->rm_rate, imp->iananame, imp->ianacode, codec_rate);
|
||||
if (map->rm_pt < 96) {
|
||||
match = (map->rm_pt == imp->ianacode) ? 1 : 0;
|
||||
} else {
|
||||
match = strcasecmp(rm_encoding, imp->iananame) ? 0 : 1;
|
||||
}
|
||||
|
||||
if (match && (map->rm_rate == imp->samples_per_second)) {
|
||||
if (match && (map->rm_rate == codec_rate)) {
|
||||
if (ptime && ptime * 1000 != imp->microseconds_per_frame) {
|
||||
near_match = imp;
|
||||
match = 0;
|
||||
|
|
Loading…
Reference in New Issue