The new formula is just the inverse function of the CFR part of
the TimeAtFrame function.
To see how the previous implementation was faulty, see either the added
tests, or
- In Aegisub, open a dummy video with a frame rate of 23.976
- Make a subtitle event with start time 04:44.41
- Double-click the line to (supposedly) seek to its first frame
- This will seek one frame earlier than it should, and the event will
not be displayed on the resulting frame.
Use explicitly defaulted destructors for base cases when possible,
eliminate aggregate initialization constructors where possible, and push
some more stuff to NSDMIs.
istringstream makes a copy of its input, which is not very nice for
performance. strstream doesn't do bounds checking, which is not very
nice for safety (and is deprecated).