SCTE-104 generation time_signal and segmentation_descriptor - #1169
Open
kierank wants to merge 5 commits into
Open
SCTE-104 generation time_signal and segmentation_descriptor#1169kierank wants to merge 5 commits into
kierank wants to merge 5 commits into
Conversation
… adjustment Three bugs in the splice insert handler: - ubuf_block_alloc return value was not checked; fatal error now thrown on allocation failure instead of crashing on the subsequent block_write - cr_dts_delay / (UCLOCK_FREQ/1000) could silently truncate to a wrong uint16_t pre_roll_time; clamped to UINT16_MAX with a warning - break_duration had the same overflow; clamped likewise - PTS adjustment unconditionally subtracted cr_dts_delay from pts_orig even when pts_orig == UINT64_MAX (no splice time present), and unconditionally set pts_prog without checking whether the clock attribute existed Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ands The handler previously assumed all input was a splice insert command. Introduce a command_type dispatch so null and time signal commands are forwarded as SCTE104_OPID_SPLICE_NULL and SCTE104_OPID_TIME_SIGNAL respectively, with pre_roll written into the TimeSignalRequestData payload. Unknown command types are dropped with a warning instead of silently producing a malformed splice message. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…criptor support
Scan SCTE-35 descriptors attached to the uref and emit corresponding
SCTE-104 operations after the main splice/time-signal op:
- Each segmentation descriptor (tag 0x02) becomes an
INSERT_SEGMENTATION_DESCRIPTOR op. Three correctness fixes are
included in this new code:
* Cancel descriptors in the size pre-calculation loop were read with
scte35_seg_desc_get_upid_length / has_sub_num without a cancel
guard, producing a wrong message length; both loops now use
cancel ? 0 : ... consistently.
* scte35_seg_desc_get_duration was called unconditionally; it now
checks scte35_seg_desc_has_duration first so that descriptors
without a duration field write zero instead of reading from the
wrong offset.
* When delivery_not_restricted is set the adjacent restriction flags
are reserved bits in SCTE-35 (all ones); the output now zeros those
SCTE-104 fields instead of copying the reserved values.
- All remaining descriptors are bundled into a single
INSERT_DESCRIPTOR op.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ubase_assert checks x == UBASE_ERR_NONE (i.e. x == 0), so passing a boolean expression asserts on success rather than failure. Use plain assert() instead. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
kierank
marked this pull request as ready for review
July 25, 2026 04:48
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.
Written by claude but working otherwise