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

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

📋 Pull Request Information

Original PR: https://github.com/CCExtractor/ccextractor/pull/1853
Author: @cfsmp3
Created: 12/19/2025
Status: Merged
Merged: 12/19/2025
Merged by: @cfsmp3

Base: masterHead: fix/wtv-timing-sync-pts


📝 Commits (1)

  • c733902 fix(wtv): Set sync_pts alongside min_pts to prevent PTS jump detection

📊 Changes

1 file changed (+4 additions, -1 deletions)

View changed files

📝 src/lib_ccx/wtv_functions.c (+4 -1)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/CCExtractor/ccextractor/pull/1853 **Author:** [@cfsmp3](https://github.com/cfsmp3) **Created:** 12/19/2025 **Status:** ✅ Merged **Merged:** 12/19/2025 **Merged by:** [@cfsmp3](https://github.com/cfsmp3) **Base:** `master` ← **Head:** `fix/wtv-timing-sync-pts` --- ### 📝 Commits (1) - [`c733902`](https://github.com/CCExtractor/ccextractor/commit/c7339024731c9b15d96470235e9c2c733a5cc52a) fix(wtv): Set sync_pts alongside min_pts to prevent PTS jump detection ### 📊 Changes **1 file changed** (+4 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/lib_ccx/wtv_functions.c` (+4 -1) </details> ### 📄 Description ## 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#2617