[PR #1806] [MERGED] fix(parser): use HHMMSSFFF format for ttxt output timestamps #2543

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

📋 Pull Request Information

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

Base: masterHead: fix/ttxt-timestamp-milliseconds


📝 Commits (1)

  • 7113036 fix(parser): use HHMMSSFFF format for ttxt output timestamps

📊 Changes

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

View changed files

📝 src/rust/src/parser.rs (+1 -1)

📄 Description

Summary

Fixes a regression in ttxt output where timestamps were missing milliseconds.

The Rust parser was incorrectly setting date_format to TimestampFormat::HHMMSS (no milliseconds) instead of TimestampFormat::HHMMSSFFF (with milliseconds) for --out=ttxt.

This bug was introduced in PR #1619 when porting the parser to Rust. The original C code correctly used ODF_HHMMSSMS which includes milliseconds in the timestamp format (HH:MM:SS,mmm).

Before (incorrect)

00:00:00|00:00:03|TLT|<font color="#ffff00">and he was pretty convinced</font>...

After (correct, matching original C behavior)

00:00:00,480|00:00:03,520|TLT|<font color="#ffff00">and he was pretty convinced</font>...

Root Cause

In src/rust/src/parser.rs, the OutFormat::Ttxt handler was setting:

self.date_format = TimestampFormat::HHMMSS;  // Wrong - no milliseconds

Instead of:

self.date_format = TimestampFormat::HHMMSSFFF;  // Correct - includes milliseconds

Verification

Tested locally with teletext sample:

ccextractor --autoprogram --out=ttxt --latin1 sample.mpg -o output.txt

Output now correctly includes milliseconds in timestamps.

Test plan

  • Verified locally that milliseconds now appear in ttxt output
  • CI teletext tests should pass

🤖 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/1806 **Author:** [@cfsmp3](https://github.com/cfsmp3) **Created:** 12/13/2025 **Status:** ✅ Merged **Merged:** 12/14/2025 **Merged by:** [@cfsmp3](https://github.com/cfsmp3) **Base:** `master` ← **Head:** `fix/ttxt-timestamp-milliseconds` --- ### 📝 Commits (1) - [`7113036`](https://github.com/CCExtractor/ccextractor/commit/7113036719592dcf5f2e5684864b191def1b75d6) fix(parser): use HHMMSSFFF format for ttxt output timestamps ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/rust/src/parser.rs` (+1 -1) </details> ### 📄 Description ## Summary Fixes a regression in ttxt output where timestamps were missing milliseconds. The Rust parser was incorrectly setting `date_format` to `TimestampFormat::HHMMSS` (no milliseconds) instead of `TimestampFormat::HHMMSSFFF` (with milliseconds) for `--out=ttxt`. This bug was introduced in PR #1619 when porting the parser to Rust. The original C code correctly used `ODF_HHMMSSMS` which includes milliseconds in the timestamp format (`HH:MM:SS,mmm`). ### Before (incorrect) ``` 00:00:00|00:00:03|TLT|<font color="#ffff00">and he was pretty convinced</font>... ``` ### After (correct, matching original C behavior) ``` 00:00:00,480|00:00:03,520|TLT|<font color="#ffff00">and he was pretty convinced</font>... ``` ## Root Cause In `src/rust/src/parser.rs`, the `OutFormat::Ttxt` handler was setting: ```rust self.date_format = TimestampFormat::HHMMSS; // Wrong - no milliseconds ``` Instead of: ```rust self.date_format = TimestampFormat::HHMMSSFFF; // Correct - includes milliseconds ``` ## Verification Tested locally with teletext sample: ``` ccextractor --autoprogram --out=ttxt --latin1 sample.mpg -o output.txt ``` Output now correctly includes milliseconds in timestamps. ## Test plan - [x] Verified locally that milliseconds now appear in ttxt output - [ ] CI teletext tests should pass 🤖 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:42 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2543