Enable in-band FEC

In-band FEC can be used with OPUS_APPLICATION_VOIP to improve Codec robustness to packet loss and corruption. It is disabled by default:

http://opus-codec.org/docs/html_api-1.0.1/group__opus__encoderctls.html#ga5b67dc832aa46c1c2f35752c46380545
This commit is contained in:
Jason Locklin 2015-07-31 11:01:32 -04:00
parent 06c72f83d7
commit bcb864af4a

View File

@ -303,6 +303,13 @@ static int init_audio_encoder(CSSession *cs)
rc = opus_encoder_ctl(cs->audio_encoder, OPUS_SET_BITRATE(cs->audio_encoder_bitrate)); rc = opus_encoder_ctl(cs->audio_encoder, OPUS_SET_BITRATE(cs->audio_encoder_bitrate));
if ( rc != OPUS_OK ) {
LOGGER_ERROR("Error while setting encoder ctl: %s", opus_strerror(rc));
return -1;
}
rc = opus_encoder_ctl(cs->audio_encoder, OPUS_SET_INBAND_FEC(1));
if ( rc != OPUS_OK ) { if ( rc != OPUS_OK ) {
LOGGER_ERROR("Error while setting encoder ctl: %s", opus_strerror(rc)); LOGGER_ERROR("Error while setting encoder ctl: %s", opus_strerror(rc));
return -1; return -1;