replay: fixed incorrect totalSeconds when there are invalid segments in route (#28388)

old-commit-hash: 67b27b7496
beeps
Dean Lee 2 years ago committed by GitHub
parent adb8a80ff4
commit f1bde81712
  1. 2
      tools/replay/replay.h

@ -68,7 +68,7 @@ public:
inline QDateTime currentDateTime() const { return route_->datetime().addSecs(currentSeconds()); }
inline uint64_t routeStartTime() const { return route_start_ts_; }
inline int toSeconds(uint64_t mono_time) const { return (mono_time - route_start_ts_) / 1e9; }
inline int totalSeconds() const { return segments_.size() * 60; }
inline int totalSeconds() const { return (!segments_.empty()) ? (segments_.rbegin()->first + 1) * 60 : 0; }
inline void setSpeed(float speed) { speed_ = speed; }
inline float getSpeed() const { return speed_; }
inline const std::vector<Event *> *events() const { return events_.get(); }

Loading…
Cancel
Save