fix 32khz isac
This commit is contained in:
parent
e57ece0d46
commit
52d558ff11
|
@ -62,19 +62,19 @@ static switch_status_t switch_isac_init(switch_codec_t *codec, switch_codec_flag
|
|||
|
||||
if (err < 0) return SWITCH_STATUS_FALSE;
|
||||
|
||||
WebRtcIsac_SetEncSampRate(context->ISAC_main_inst, codec->implementation->actual_samples_per_second / 1000);
|
||||
WebRtcIsac_SetDecSampRate(context->ISAC_main_inst, codec->implementation->actual_samples_per_second / 1000);
|
||||
|
||||
if (encoding) {
|
||||
if (WebRtcIsac_EncoderInit(context->ISAC_main_inst, 0) < 0) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
WebRtcIsac_SetEncSampRate(context->ISAC_main_inst, codec->implementation->actual_samples_per_second / 1000);
|
||||
}
|
||||
|
||||
if (decoding) {
|
||||
if (WebRtcIsac_DecoderInit(context->ISAC_main_inst) < 0) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
WebRtcIsac_SetDecSampRate(context->ISAC_main_inst, codec->implementation->actual_samples_per_second / 1000);
|
||||
}
|
||||
|
||||
if (codec->implementation->actual_samples_per_second == 16000) {
|
||||
|
@ -82,13 +82,14 @@ static switch_status_t switch_isac_init(switch_codec_t *codec, switch_codec_flag
|
|||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
} else {
|
||||
if (WebRtcIsac_Control(context->ISAC_main_inst, codec->implementation->actual_samples_per_second / 1000,
|
||||
codec->implementation->microseconds_per_packet / 1000) < 0) {
|
||||
|
||||
if (WebRtcIsac_Control(context->ISAC_main_inst, codec->implementation->bits_per_second, codec->implementation->microseconds_per_packet / 1000) < 0) {
|
||||
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (WebRtcIsac_SetMaxPayloadSize(context->ISAC_main_inst, SWITCH_RECOMMENDED_BUFFER_SIZE) < 0) {
|
||||
if (WebRtcIsac_SetMaxPayloadSize(context->ISAC_main_inst, codec->implementation->decoded_bytes_per_packet) < 0) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
|
@ -224,13 +225,13 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_isac_codec_load)
|
|||
SWITCH_CODEC_TYPE_AUDIO,
|
||||
99,
|
||||
"isac",
|
||||
NULL,
|
||||
"ibitrate=20000;maxbitrate=45000",
|
||||
32000,
|
||||
32000,
|
||||
160000,
|
||||
30000,
|
||||
960,
|
||||
1920,
|
||||
3840,
|
||||
7680,
|
||||
0,
|
||||
1,
|
||||
6,
|
||||
|
|
Loading…
Reference in New Issue