56a54c2b9a3cf55b61f098a5f3648854f237feab
normalize_segments repairs what Whisper actually emits: an end timestamp of -1 when the closing token is never predicted (usually the trailing chunk), out-of-bounds and inverted spans, and blank text. Left alone these produce malformed subtitles. It also warns when chunk starts are non-monotonic, which is the cheap signal that start_ts is window-relative rather than absolute -- that would misplace every cue past 0:30, and it should surface as a log line rather than a user report. Timestamps convert to integer milliseconds before splitting into fields; formatting the seconds field directly renders 3599.9996 as "00:59:60.000". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Description
No description provided
280 KiB
Languages
Python
99.7%
Shell
0.3%