Skip to content

Commit 8988152

Browse files
cfsmp3claude
andcommitted
fix(rcwt): Fix timestamp calculation for RCWT/BIN format files
The rcwt_loop() function set min_pts = 0 for RCWT files but did not set pts_set = 2 (MinPtsSet). This caused the Rust timing code to skip the fts_now calculation (which checks pts_set == MinPtsSet), resulting in all captions having timestamps compressed near 0 instead of their correct times spread across the file duration. The fix adds pts_set = 2 after setting min_pts, which tells the timing system that min_pts is valid and fts_now can be calculated properly. Fixes Test 217 timing issue where: - Before: 00:00:00,001 --> 00:00:00,091 (wrong) - After: 00:00:02,402 --> 00:00:04,536 (correct) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 78642bc commit 8988152

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib_ccx/general_loop.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1392,9 +1392,12 @@ int rcwt_loop(struct lib_ccx_ctx *ctx)
13921392
dec_sub = &dec_ctx->dec_sub;
13931393
telctx = dec_ctx->private_data;
13941394

1395-
/* Set minimum and current pts since rcwt has correct time */
1395+
/* Set minimum and current pts since rcwt has correct time.
1396+
* Also set pts_set = 2 (MinPtsSet) so the Rust timing code knows
1397+
* that min_pts is valid and can calculate fts_now properly. */
13961398
dec_ctx->timing->min_pts = 0;
13971399
dec_ctx->timing->current_pts = 0;
1400+
dec_ctx->timing->pts_set = 2; // 2 = min_pts set
13981401

13991402
// Loop until no more data is found
14001403
while (1)

0 commit comments

Comments
 (0)