mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00

We previously parsed an arbitrary number of decimal places, but assumed the value was in milliseconds, which doesn't make sense if there is greater or fewer than 3. This change restricts the parsing to match exactly 3, meaning the millisecond assumption is always true. The WebVTT spec requires there to be exactly 3 decimal places: https://www.w3.org/TR/webvtt1/#webvtt-timestamp The SubRip spec is less clearly defined, but the Wikipedia article defines it as having exactly 3 decimal places (https://en.wikipedia.org/wiki/SubRip#Format) and ExoPlayer has always assumed 3 decimal places (anything else is already handled incorrectly), so this change just ensures we don't show subtitles at the wrong time. Issue: androidx/media#1997 PiperOrigin-RevId: 712885023