mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
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:
parent
bcb864af4a
commit
ef086a5897
|
@ -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 ) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user