提交 17b88eb6 authored 作者: Chris Rienzo's avatar Chris Rienzo 提交者: Andrey Volk

FS-11785 [mod_opus] move fec_bitrate scope to a better place

上级 681b7e28
...@@ -642,12 +642,11 @@ static switch_status_t switch_opus_init(switch_codec_t *codec, switch_codec_flag ...@@ -642,12 +642,11 @@ static switch_status_t switch_opus_init(switch_codec_t *codec, switch_codec_flag
if (opus_codec_settings.useinbandfec) { if (opus_codec_settings.useinbandfec) {
/* FEC on the encoder: start the call with a preconfigured packet loss percentage */ /* FEC on the encoder: start the call with a preconfigured packet loss percentage */
int fec_bitrate;
int loss_percent = opus_prefs.plpct ; int loss_percent = opus_prefs.plpct ;
opus_encoder_ctl(context->encoder_object, OPUS_SET_INBAND_FEC(opus_codec_settings.useinbandfec)); opus_encoder_ctl(context->encoder_object, OPUS_SET_INBAND_FEC(opus_codec_settings.useinbandfec));
opus_encoder_ctl(context->encoder_object, OPUS_SET_PACKET_LOSS_PERC(loss_percent)); opus_encoder_ctl(context->encoder_object, OPUS_SET_PACKET_LOSS_PERC(loss_percent));
if (opus_prefs.keep_fec){ if (opus_prefs.keep_fec){
fec_bitrate = switch_opus_get_fec_bitrate(enc_samplerate,loss_percent); int fec_bitrate = switch_opus_get_fec_bitrate(enc_samplerate,loss_percent);
/* keep a bitrate for which the encoder will always add FEC */ /* keep a bitrate for which the encoder will always add FEC */
if (fec_bitrate != SWITCH_STATUS_FALSE) { if (fec_bitrate != SWITCH_STATUS_FALSE) {
opus_encoder_ctl(context->encoder_object, OPUS_SET_BITRATE(fec_bitrate)); opus_encoder_ctl(context->encoder_object, OPUS_SET_BITRATE(fec_bitrate));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论