From bcb864af4ac51fb78cdac9df249949d6fbca937a Mon Sep 17 00:00:00 2001 From: Jason Locklin Date: Fri, 31 Jul 2015 11:01:32 -0400 Subject: 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 --- toxav/codec.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/toxav/codec.c b/toxav/codec.c index 71d24e87..7b76929c 100644 --- a/toxav/codec.c +++ b/toxav/codec.c @@ -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)); + 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 ) { LOGGER_ERROR("Error while setting encoder ctl: %s", opus_strerror(rc)); return -1; -- cgit v1.2.3