• Iñaki Baz Castillo's avatar
    RateCalculator: improve efficiency (#324) · d4396745
    由 Iñaki Baz Castillo 提交于
    * Store `this->lastTime` and `this->lastRate` when calling `GetRate(now)` and return `this->lastRate` if `GetRate(now)` is called with `now == this->lastTime` (instead of calculating the rate again).
    * Reset both `this->lastTime` and `this->lastRate` to 0 when calling `Reset()` or `Update()` (to allow that immediate new calls to `GetRate()` with same `now` trigger a new rate calculation).
    * Avoid unnecessary calls to `GetRate()` in `RemoteBitrateEstimatorAbsSendTime` (even if no longer necessary with the changes above, but looks better).
    d4396745
RemoteBitrateEstimatorAbsSendTime.cpp 12.6 KB