Slowly back off sampling rate when selected source loses connectivity

This commit is contained in:
Miroslav Lichvar 2010-12-06 14:53:37 +01:00
parent 4e318c1abc
commit 8b93e1a780

View file

@ -645,20 +645,13 @@ transmit_timeout(void *arg)
/* Nothing */ /* Nothing */
} }
/* If the source to which we are currently locked starts to lose /* If the source loses connectivity, back off the sampling rate to reduce
connectivity, increase the sampling rate to try and bring it wasted sampling. If it's the source to which we are currently locked,
back. If any other source loses connectivity, back off the back off slower. */
sampling rate to reduce wasted sampling. */
if (SRC_IsSyncPeer(inst->source)) { if (inst->tx_count >= 2) {
if (inst->tx_count >= 2) { /* Implies we have missed at least one transmission */
/* Implies we have missed at least one transmission */ adjust_poll(inst, SRC_IsSyncPeer(inst->source) ? 0.1 : 0.25);
adjust_poll(inst, -0.75);
}
} else {
if (inst->tx_count >= 2) {
adjust_poll(inst, 0.25);
}
} }
my_mode = inst->mode; my_mode = inst->mode;