Skip to content

Commit a0593c6

Browse files
authored
fix: RCWT/WTV timing fixes, Latin-1 music note encoding
2 parents 2060db9 + 300f8ca commit a0593c6

File tree

5 files changed

+25
-9
lines changed

5 files changed

+25
-9
lines changed

CI_TRIAGE_DEC_2025.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,16 @@ considers them regressions because the "ground truth" baseline is outdated. This
1111
2. Systematically analyze each failing test
1212
3. Determine whether to update ground truth or fix code
1313

14-
## Failing Tests to Triage
14+
## Merged Fixes
1515

16-
Will be populated after CI run completes.
16+
The following PRs have been merged and this run verifies their combined effect:
17+
18+
- **PR #1847**: Hardsubx crash fix, memory leak fixes, rcwt exit code fix
19+
- **PR #1848**: XDS empty content entries fix
1720

1821
## Status
1922

20-
- [ ] CI run triggered
23+
- [x] PR #1847 merged
24+
- [x] PR #1848 merged
25+
- [ ] Verification CI run triggered
2126
- [ ] Results analyzed
22-
- [ ] Triage decisions made

src/ccextractor.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
/* CCExtractor, originally by carlos at ccextractor.org, now a lot of people.
33
Credits: See AUTHORS.TXT
44
License: GPL 2.0
5+
6+
CI verification run: 2025-12-19T08:30 - Testing merged fixes from PRs #1847 and #1848
57
*/
68
#include "ccextractor.h"
79
#include <stdio.h>

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)

src/lib_ccx/wtv_functions.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,15 @@ LLONG get_data(struct lib_ccx_ctx *ctx, struct wtv_chunked_buffer *cb, struct de
436436
dbg_print(CCX_DMT_PARSE, "TIME: %ld\n", time);
437437
if (time != -1 && time != WTV_CC_TIMESTAMP_MAGIC)
438438
{ // Ignore -1 timestamps
439-
set_current_pts(dec_ctx->timing, time_to_pes_time(time));
440-
dec_ctx->timing->pts_set = 1;
439+
LLONG pes_time = time_to_pes_time(time);
440+
set_current_pts(dec_ctx->timing, pes_time);
441+
// Set min_pts on first valid timestamp to enable fts_now calculation
442+
if (dec_ctx->timing->min_pts == 0x01FFFFFFFF || pes_time < dec_ctx->timing->min_pts)
443+
{
444+
dec_ctx->timing->min_pts = pes_time;
445+
}
446+
// pts_set = 2 (MinPtsSet) is required for proper fts_now calculation
447+
dec_ctx->timing->pts_set = 2;
441448
frames_since_ref_time = 0;
442449
set_fts(dec_ctx->timing);
443450
}

src/rust/lib_ccxr/src/util/encoding.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ fn latin1_to_line21(c: Latin1Char) -> Line21Char {
584584
0xbf => 0x83, // Inverted (open) question mark
585585
0xa2 => 0x85, // Cents symbol
586586
0xa3 => 0x86, // Pounds sterling
587-
0xb6 => 0x87, // Music note (pilcrow in Latin-1)
587+
b'#' => 0x87, // Music note (# in Latin-1)
588588
0xe0 => 0x88, // lowercase a, grave accent
589589
0x20 => 0x89, // transparent space
590590
0xe8 => 0x8a, // lowercase e, grave accent
@@ -682,7 +682,7 @@ pub fn line21_to_latin1(c: Line21Char) -> Latin1Char {
682682
0x84 => UNAVAILABLE_CHAR, // Trademark symbol (TM) - Does not exist in Latin 1
683683
0x85 => 0xa2, // Cents symbol
684684
0x86 => 0xa3, // Pounds sterling
685-
0x87 => 0xb6, // Music note - Not in latin 1, so we use 'pilcrow'
685+
0x87 => b'#', // Music note - Not in latin 1, so we use '#'
686686
0x88 => 0xe0, // lowercase a, grave accent
687687
0x89 => 0x20, // transparent space, we make it regular
688688
0x8a => 0xe8, // lowercase e, grave accent

0 commit comments

Comments
 (0)