Repository navigation
Description
Location
plugins/obs-outputs/rtmp-hevc.c.h — the HEVCDecoderConfigurationRecord writer, three sites AppleClang reports once the obs-outputs conversion ratchet (#2872 for #2625) is on:
| Line | Code | Diagnostic |
|---|---|---|
| 827 | s_w8(&s, hvcc.general_profile_space << 6 | hvcc.general_tier_flag << 5 | hvcc.general_profile_idc); |
implicit conversion loses integer precision: 'int' to 'uint8_t' [-Werror,-Wimplicit-int-conversion] |
| 843 | s_w8(&s, hvcc.constantFrameRate << 6 | hvcc.numTemporalLayers << 3 | hvcc.temporalIdNested << 2 | hvcc.lengthSizeMinusOne); |
same |
| 853 | s_w8(&s, (array->array_completeness << 7) | (array->NAL_unit_type & 0x3f)); |
same |
Class
Build break (conversion diagnostic), no behaviour change: the shifts are of narrow unsigned bitfields promoted to int, and the truncated low byte is what the record has always carried.
How it is reached
Every macOS build with the ratchet on — Build 🧱 / macOS 🍏 (arm64), (x86_64) and Analyze 🔬 / macOS 🍏 (clang-analyze) — on master's own unity target obs-outputs.hevc+.h.c. Found while validating #2922 (the mp4-mux conversions of #2921) with a workflow_dispatch of scheduled.yaml on branch fix/2921-mp4-mux-conversions, run 40890899955:
Build 🧱 / macOS 🍏 (arm64) job 123507367938 failure
Build 🧱 / macOS 🍏 (x86_64) failure
Analyze 🔬 / macOS 🍏 (clang-analyze) failure
[obs-outputs] Compiling obs-outputs.mp4-mux+.h.c # #2922's file, now clean
[obs-outputs] Compiling obs-outputs.hevc+.h.c
##[error]implicit conversion loses integer precision: 'int' to 'uint8_t' (aka 'unsigned char') [-Werror,-Wimplicit-int-conversion]
827 | s_w8(&s, hvcc.general_profile_space << 6 | hvcc.general_tier_flag << 5 | hvcc.general_profile_idc);
So #2922 fixes mp4-mux but does not turn the lane green; this is the next file the unity build reaches. The mp4-mux PR stays scoped to its issue and this one carries the rest.
Proposed fix and failing test
State the conversions at the three call sites, exactly as #2922 does for mp4-mux — no flag, pin or target change:
s_w8(&s, (uint8_t)(hvcc.general_profile_space << 6 | hvcc.general_tier_flag << 5 |
hvcc.general_profile_idc));
s_w8(&s, (uint8_t)(hvcc.constantFrameRate << 6 | hvcc.numTemporalLayers << 3 |
hvcc.temporalIdNested << 2 | hvcc.lengthSizeMinusOne));
s_w8(&s, (uint8_t)((array->array_completeness << 7) | (array->NAL_unit_type & 0x3f)));The field widths fit the byte: 2+1+5, 2+3+1+2 and 1+6 bits respectively, so the cast truncates nothing that was not already truncated by s_w8.
RED: the run above (master code in that file, no change from this branch touches it). GREEN: a workflow_dispatch of scheduled.yaml on the fixing branch with those three macOS jobs green, plus a local clang -Wconversion -Wsign-conversion -Wimplicit-int-conversion -Werror compile of the old and new expressions showing the same emitted bytes.
Tiers that do not apply: no Rust unit, C test or protocol-format change; test/cmocka/ and the record layout are untouched.
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Oct 29, 2026
Claiming: the rtmp-hevc record conversions
scheduled.yamlrun 40890899955 on branchfix/2921-mp4-mux-conversionsalready fails the three macOS jobs in this file, on master code; recorded in the issue.s_w8call sites inplugins/obs-outputs/rtmp-hevc.c.h, checked against the old expressions byte-for-byte, then aworkflow_dispatchofscheduled.yamlon the branch with arm64, x86_64 and clang-analyze green../lint, PR againstmaster(Refs #2928), hand off at the merge queue.First PR today.
zackees commentedon Oct 29, 2026
Progress: branch
fix/2928-rtmp-hevc-conversions, PR #2929 (draft). Three casts in,./lintclean, 640-combination probe shows identical bytes, local clang RED 3/3 -> GREEN. The macOS dispatch on that branch compilesobs-outputs.hevc+.h.cwith no diagnostics; the lane stays red only on mp4-mux until #2922 lands, so full green evidence comes after a rebase onto it.zackees commentedon Oct 29, 2026
Status after today's merges, so this does not look stalled:
(uint8_t)((array->array_completeness << 7) | ...)) and is in the merge queue. It is filed asFixes #2921, so this issue stays open until someone confirms the file is clean on master after that lands; the macOS lane is the authority either way.I closed #2929 as superseded (it was a subset of #2925 + #2922). Nothing else is queued against this file.
zackees commentedon Oct 29, 2026
Status:
rtmp-hevc.c.h827 and 843 are already on master — they landed inside #2925(
6c5fd4516, merged 15:21 UTC) as part of the Sanitizers-lane fix, which cast the same twos_w8()arguments. Only line 853 (
(uint8_t)((array->array_completeness << 7) | ...), clang-only: gcc's-Wconversionfolds it away) is still unmerged, and this issue's PR #2929 covers all three sites.Another branch also carries 853 right now (PR #2922, whose macOS dispatch is what found the sites),
so whichever of #2922 and #2929 lands first turns this green; the second one drops the duplicated hunk
at rebase. Do not close this issue on 827/843 alone.
Both PRs are currently blocked from macOS evidence by #2938 (master's frontend conversion group left
63 files unconverted, so every app lane is red past
obs-outputs).zackees commentedon Oct 29, 2026
All three casts in
plugins/obs-outputs/rtmp-hevc.c.hare on master now: 827 and 843 via #2925 (6c5fd45), and 853 via #2922, which landed with the mp4-mux and mp4-output conversions. Nothing left here, so closing.macOS x86_64 compiles
obs-outputs.hevc+.h.cwith no diagnostics; the app build's remaining red is #2938's frontend conversions.zackees commentedon Oct 29, 2026
Claiming: HEVC record writer's remaining conversion (#2928)
Continuing this one — it is already assigned to me.
Re-checked against
master(3682bdb50): #2925 stated 827 and 843; the third site, the NAL-array header byte at 853, is still unstated, and it is the oneobs-outputs.hevc+.h.creaches next.Plan:
fix/2928-hevc-array-byte): the(uint8_t)cast at 853, with local RED/GREENclang -fsyntax-onlyof the unity target under the ratchet's flags, and an exhaustive probe over all 65,536(array_completeness, NAL_unit_type)pairs showing the same emitted byte.scheduled.yamlworkflow_dispatchon that branch, since a PR run does not select the macOS app build for aplugins/obs-outputspath.First PR expected: #2941, up now.
github-actions commentedon Oct 29, 2026
Claim bot: @zackees, this issue is closed; reopen it first if work remains.
zackees commentedon Oct 29, 2026
Fixed on master by
985ccf278(#2922, merged 16:03 UTC): the NAL-array byte at 853 was the third site that PR carried, alongside 827 and 843 from #2925. Nothing was left for this issue.Verification on current master (
c2df54a7f), the ratchet's flags on the two unity targets:git show origin/master:plugins/obs-outputs/rtmp-hevc.c.h | sed -n '853p'is the cast expression, so the diagnostic this issue reported no longer reproduces.My attempt at it (#2941,
fix/2928-hevc-array-byte) was branched from a master snapshot taken before985ccf278merged and is therefore an empty diff against today's master; the coordinator closed it and I have deleted the branch. Closing this issue as done.