cdown/srt

srt is not robust to timestamps whose ms fields do not have exactly 3 digits

Closed this issue · 0 comments

First off, awesome library -- I use this in one of my projects and have found it a delight to work with.

Perhaps this isn't an issue with srt but with improperly formatted srt files. Apparently, sometimes the millisecond field in some timestamps does not have exactly 3 digits, and this causes srt to fail to parse the content. Apparently this does happen in practice; see smacke/ffsubsync#45 for an example spotted by one of my users. It would be awesome if srt could be tolerant to such cases. I tested a diff that seems to provide the requested fix, but it does come at perf cost. I'll send a PR and we can discuss more whether the perf hit is justified.