[PR #1853] fix(wtv): Set sync_pts alongside min_pts to prevent PTS jump detection #2619

Closed
opened 2026-01-29 17:23:06 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/CCExtractor/ccextractor/pull/1853

State: closed
Merged: Yes


Summary

Fixes a regression introduced in PR #1849 (commit 300f8ca6) where WTV files with large initial PTS values would produce empty output.

Root cause: The WTV timing fix set min_pts and pts_set=2 (MinPtsSet) but didn't set sync_pts. The Rust timing code checks for PTS jumps by computing current_pts - sync_pts, and with sync_pts=0 but current_pts at a large value (e.g., 6039323550 for a file starting at 18:38:23), the difference triggered false PTS jump detection.

Fix: Set sync_pts to the same value as min_pts when first initializing timing.

Test results

Before (master):

Last sync PTS value: 0
Current PTS value: 6039323550
Note: You can disable this behavior by adding -ignoreptsjumps to the parameters.

Output: Empty file, progress showed -1118:-23 (negative hours!)

After (this fix):

  • Caption 1: 00:00:00,601 --> 00:00:02,801 Matches expected
  • Caption 2: 00:00:02,837 --> 00:00:06,305 Matches expected
  • Caption 3: 00:00:11,145 --> 00:00:12,411 Matches expected

Tested on all WTV samples in the test corpus - all produce correct output.

Test plan

  • CI regression tests pass for WTV section
  • Test 95 now passes (was showing empty result vs expected captions)

🤖 Generated with Claude Code

**Original Pull Request:** https://github.com/CCExtractor/ccextractor/pull/1853 **State:** closed **Merged:** Yes --- ## Summary Fixes a regression introduced in PR #1849 (commit 300f8ca6) where WTV files with large initial PTS values would produce empty output. **Root cause:** The WTV timing fix set `min_pts` and `pts_set=2` (MinPtsSet) but didn't set `sync_pts`. The Rust timing code checks for PTS jumps by computing `current_pts - sync_pts`, and with `sync_pts=0` but `current_pts` at a large value (e.g., 6039323550 for a file starting at 18:38:23), the difference triggered false PTS jump detection. **Fix:** Set `sync_pts` to the same value as `min_pts` when first initializing timing. ## Test results **Before (master):** ``` Last sync PTS value: 0 Current PTS value: 6039323550 Note: You can disable this behavior by adding -ignoreptsjumps to the parameters. ``` Output: Empty file, progress showed `-1118:-23` (negative hours!) **After (this fix):** - Caption 1: `00:00:00,601 --> 00:00:02,801` ✅ Matches expected - Caption 2: `00:00:02,837 --> 00:00:06,305` ✅ Matches expected - Caption 3: `00:00:11,145 --> 00:00:12,411` ✅ Matches expected Tested on all WTV samples in the test corpus - all produce correct output. ## Test plan - [ ] CI regression tests pass for WTV section - [ ] Test 95 now passes (was showing empty result vs expected captions) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
claunia added the pull-request label 2026-01-29 17:23:06 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2619