eta: Fix ETA oddness at crossover points
authorSitsofe Wheeler <sitsofe@yahoo.com>
Sun, 27 Nov 2016 20:44:30 +0000 (20:44 +0000)
committerSitsofe Wheeler <sitsofe@yahoo.com>
Sun, 27 Nov 2016 21:40:26 +0000 (21:40 +0000)
commitae5eaf076dc66144d88715740cb15f23880cc55e
tree1624fdfe822092853b723f5d295eaa1441fa67a0
parent819a4a96b6ee8ba5ec631b63ae10b82d28c7d0d0
eta: Fix ETA oddness at crossover points

- Avoid generating a NaN (because casting NaN to an integer is
  undefined) due to no work having been done by clamping ETA to the
  timeout in that scenario.
- Fix the ETA spiking just as ramp time finishes by not adding it to the
  ETA calculation when it's over.

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
eta.c