[PR #1824] [MERGED] fix(timing): Set pts_set to MinPtsSet after PTS jump (fixes #1277) #2571

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

📋 Pull Request Information

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

Base: masterHead: fix/issue-1277-pts-jump-timing


📝 Commits (1)

  • 00d0777 fix(timing): Set pts_set to MinPtsSet after PTS jump to continue fts_now updates

📊 Changes

1 file changed (+10 additions, -6 deletions)

View changed files

📝 src/rust/lib_ccxr/src/time/timing.rs (+10 -6)

📄 Description

Summary

  • Fixed issue where DVD VOB files with PTS discontinuities stopped extracting captions after ~6 minutes
  • When a PTS jump is detected, the code now properly sets pts_set = MinPtsSet after updating min_pts, enabling continued fts_now calculation
  • This was a regression introduced in v0.85 - version 0.84 worked correctly

Root Cause

In set_fts() when handling PTS jumps:

  1. The code updated fts_offset and min_pts for the new timeline
  2. But it set pts_set = Received without ever setting it back to MinPtsSet
  3. The fts_now calculation only runs when pts_set == MinPtsSet, so after a PTS jump, all timestamps would be stuck

Fix

Set pts_set = MinPtsSet after setting min_pts in the PTS jump handling code. This allows fts_now to continue being calculated correctly after the discontinuity.

Test Results

Before fix: Only 213 captions extracted, timing stuck at ~7 minutes
After fix: All 618 captions extracted, timing correctly continues to ~21 minutes (matching v0.84 reference output)

Test plan

  • Tested with issue #1277 sample files (DVD VOB files with PTS discontinuities)
  • Verified output matches v0.84 reference (618 captions, timing to ~21 minutes)
  • All 265 Rust unit tests pass
  • Clippy lint check passes

🤖 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/1824 **Author:** [@cfsmp3](https://github.com/cfsmp3) **Created:** 12/14/2025 **Status:** ✅ Merged **Merged:** 12/14/2025 **Merged by:** [@cfsmp3](https://github.com/cfsmp3) **Base:** `master` ← **Head:** `fix/issue-1277-pts-jump-timing` --- ### 📝 Commits (1) - [`00d0777`](https://github.com/CCExtractor/ccextractor/commit/00d07776f69aaedf2f72a891e31408d674f947b2) fix(timing): Set pts_set to MinPtsSet after PTS jump to continue fts_now updates ### 📊 Changes **1 file changed** (+10 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src/rust/lib_ccxr/src/time/timing.rs` (+10 -6) </details> ### 📄 Description ## Summary - Fixed issue where DVD VOB files with PTS discontinuities stopped extracting captions after ~6 minutes - When a PTS jump is detected, the code now properly sets `pts_set = MinPtsSet` after updating `min_pts`, enabling continued `fts_now` calculation - This was a regression introduced in v0.85 - version 0.84 worked correctly ## Root Cause In `set_fts()` when handling PTS jumps: 1. The code updated `fts_offset` and `min_pts` for the new timeline 2. But it set `pts_set = Received` without ever setting it back to `MinPtsSet` 3. The `fts_now` calculation only runs when `pts_set == MinPtsSet`, so after a PTS jump, all timestamps would be stuck ## Fix Set `pts_set = MinPtsSet` after setting `min_pts` in the PTS jump handling code. This allows `fts_now` to continue being calculated correctly after the discontinuity. ## Test Results Before fix: Only 213 captions extracted, timing stuck at ~7 minutes After fix: All 618 captions extracted, timing correctly continues to ~21 minutes (matching v0.84 reference output) ## Test plan - [x] Tested with issue #1277 sample files (DVD VOB files with PTS discontinuities) - [x] Verified output matches v0.84 reference (618 captions, timing to ~21 minutes) - [x] All 265 Rust unit tests pass - [x] Clippy lint check passes 🤖 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:22:50 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2571