Skip to content
This repository has been archived by the owner on May 12, 2024. It is now read-only.

Commit

Permalink
Implement better fix for time rounding
Browse files Browse the repository at this point in the history
  • Loading branch information
Ristellise committed Jul 13, 2021
1 parent a918469 commit 41362c8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libaegisub/ass/time.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,10 @@ std::string Time::GetSrtFormatted() const {
}

void Time::RoundTime() {
float floatTime = (float)this->time / 10.0f;

time = floor(floatTime - 0.5) * 10;
if (this->time % 10 == 0)
return;
else
this->time = this->time - this->time % 10;
}

SmpteFormatter::SmpteFormatter(vfr::Framerate fps, char sep)
Expand Down

0 comments on commit 41362c8

Please sign in to comment.