diff options
author | Jason Locklin <jalockli@uwaterloo.ca> | 2015-07-31 11:01:32 -0400 |
---|---|---|
committer | Jason Locklin <jalockli@uwaterloo.ca> | 2015-07-31 11:01:32 -0400 |
commit | bcb864af4ac51fb78cdac9df249949d6fbca937a (patch) | |
tree | 1e04b4297697cca072192c691145c4738f3ba495 | |
parent | 06c72f83d79e38b0421fdfe1d4b1bf8f5bf3b9c9 (diff) |
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
-rw-r--r-- | toxav/codec.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/toxav/codec.c b/toxav/codec.c index 71d24e87..7b76929c 100644 --- a/toxav/codec.c +++ b/toxav/codec.c | |||
@@ -307,6 +307,13 @@ static int init_audio_encoder(CSSession *cs) | |||
307 | LOGGER_ERROR("Error while setting encoder ctl: %s", opus_strerror(rc)); | 307 | LOGGER_ERROR("Error while setting encoder ctl: %s", opus_strerror(rc)); |
308 | return -1; | 308 | return -1; |
309 | } | 309 | } |
310 | |||
311 | rc = opus_encoder_ctl(cs->audio_encoder, OPUS_SET_INBAND_FEC(1)); | ||
312 | |||
313 | if ( rc != OPUS_OK ) { | ||
314 | LOGGER_ERROR("Error while setting encoder ctl: %s", opus_strerror(rc)); | ||
315 | return -1; | ||
316 | } | ||
310 | 317 | ||
311 | rc = opus_encoder_ctl(cs->audio_encoder, OPUS_SET_COMPLEXITY(10)); | 318 | rc = opus_encoder_ctl(cs->audio_encoder, OPUS_SET_COMPLEXITY(10)); |
312 | 319 | ||