pbs / pycaption

Python module to read/write popular video caption formats
Apache License 2.0
256 stars 136 forks source link

Timing of captions is incorrectly calculated, when converting from dfxp to all other formats #61

Closed vladiibine closed 8 years ago

vladiibine commented 9 years ago

The fractions of seconds are incorrectly converted. As am example, timings such as '01:02:03.9' (representing hour:minute:second.fraction) are converted to '01:02:03.009' .

In this case fractions are divided by 100, but if the fraction were 2 decimals long (say '.84'), the resulting fraction would be '.084'.

The timing is only calculated properly for fractions with exactly 3 decimals.

And of course, if we have more than 3 decimals specified, the second counter might be affected. For a large enough number of decimals, we could even get the time specification in seconds to go above 60.

vladiibine commented 9 years ago

Correction, we can't go over 60 with the number of seconds. Those extra seconds will be added to the minutes - nonetheless, the calculations are inaccurate.