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

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

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

State: closed
Merged: Yes


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

**Original Pull Request:** https://github.com/CCExtractor/ccextractor/pull/1824 **State:** closed **Merged:** Yes --- ## 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)
claunia added the pull-request label 2026-01-29 17:22:52 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2576