Set packet loss percentage

Make the Codec resistant to up to 10% packet loss (default 0) at the expense of some bandwidth.  10% is aggressive (1-5% should be typical for voip systems, but can be higher when users are on WiFi connections. This could also be adjusted on the fly, rather than hard-coded, with feedback from the receiving client.
This commit is contained in:
Jason Locklin 2015-07-31 11:08:51 -04:00
parent bcb864af4a
commit ef086a5897

View File

@ -315,6 +315,14 @@ static int init_audio_encoder(CSSession *cs)
return -1;
}
/* Make codec resistant to up to 10% packet loss */
rc = opus_encoder_ctl(cs->audio_encoder, OPUS_SET_PACKET_LOSS_PERC(10));
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_COMPLEXITY(10));
if ( rc != OPUS_OK ) {