static_cast<int> truncates, so a computed end frame of 99.999999999998 would result in 99, instead of the correct 100.