Open
Conversation
Fixes two bugs causing timing drift in H.264 ATSC caption streams:
Bug 1: Gap detection threshold too low (100ms)
- Triggered on normal B-frame spacing (133ms) instead of real gaps
- Added H264_GAP_THRESHOLD_MS = 500ms for H.264 streams
- MPEG-2 keeps 100ms threshold (works correctly for I-frame detection)
- Gap now triggers at frame 78 (~634ms gap), capturing correct PTS
Bug 2: Serialization bug (fields lost across C↔Rust boundary)
- first_large_gap_pts and seen_large_gap discarded during round-trips
- Fixed as_raw_parts/from_raw_parts to preserve fields
- Updated 7 files to maintain state across FFI boundary
Changes:
- src/rust/lib_ccxr/src/time/timing.rs: Core fix (threshold + serialization)
- src/lib_ccx/ccx_common_timing.{c,h}: C struct fields for round-trip
- src/rust/src/libccxr_exports/time.rs: FFI serialization logic
- src/rust/lib_ccxr/src/common/options.rs: Rust struct mirror
- src/rust/src/{common,ctorust}.rs: Conversion helpers
- src/lib_ccx/ccx_decoders_608.c: CEA-608 pop-on timing fixes
- src/lib_ccx/general_loop.c: Remove obsolete ATSC_CC workaround
- src/lib_ccx/ts_functions.c: Formatting fix (add braces)
Results (Test 226):
- Before: 13,613ms (missing start credits)
- After: 04,507ms (start credits present, 51ms from target)
- Expected: 04,456ms (Sample Platform HTML diff)
- Improvement: 8.9 seconds → 51ms drift
…on source changes
Collaborator
CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit 0626bb5...:
Your PR breaks these cases:
Congratulations: Merging this PR would fix the following tests:
It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you). Check the result page for more info. |
Collaborator
CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results, when compared to test for commit 0626bb5...:
Your PR breaks these cases:
NOTE: The following tests have been failing on the master branch as well as the PR:
Congratulations: Merging this PR would fix the following tests:
It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you). Check the result page for more info. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
Summary
What was broken
Root cause: In the pop-on to roll-up caption transition, current_visible_start_ms was left at 0, causing start-credits to either not appear or appear with wrong timing.
The Fix
Test result