Skip to content

build(obs-outputs): state the HEVC record's array-byte conversion (#2928) - #2941

Closed
zackees wants to merge 1 commit into
masterfrom
fix/2928-hevc-array-byte
Closed

zackees wants to merge 1 commit into
masterfrom
fix/2928-hevc-array-byte

Conversation

@zackees

@zackees zackees commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Fixes #2928 — the last of the three HEVC configuration-record bytes.

#2925 (6c5fd4516) landed the profile/tier byte (827) and the frame-rate byte (843) on master. The third site — the NAL-array header byte at 853 — is still there, and it is what the obs-outputs.hevc+.h.c unity target hits once those two are stated:

rtmp-hevc.c.h:853:45: error: implicit conversion loses integer precision: 'int' to 'uint8_t' (aka 'unsigned char') [-Werror,-Wimplicit-int-conversion]
  853 |                 s_w8(&s, (array->array_completeness << 7) | (array->NAL_unit_type & 0x3f));
      |                 ~~~~     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The fix is the same shape as the other two: cast the expression at the call site. The field widths are 1 + 6 bits, so the low byte is the only byte the record ever carried; s_w8() took a uint8_t before and takes one now.

RED

Local, master's code, the ratchet's flags, on the unity target:

clang -fsyntax-only -std=gnu17 -DENABLE_HEVC -DCRYPTO -DUSE_MBEDTLS -DSIMDE_ENABLE_OPENMP \
  -I. -Iplugins/obs-outputs -Ilibobs -Ibuild/config ... \
  -Wconversion -Wsign-conversion -Wfloat-conversion -Werror \
  plugins/obs-outputs/build/obs-outputs.hevc+.h.c

→ the diagnostic above, rc=1. (gcc -Wconversion accepts it, which is why the Linux replay of the ratchet was green; AppleClang's -Wimplicit-int-conversion is the one that fires.)

GREEN

The same command after the cast: no diagnostics, rc=0.

On the real macOS lanes, scheduled.yaml workflow_dispatch on this branch (40913129884) — a PR run does not select the macOS app build for a plugins/obs-outputs path, so this is the lane evidence:

Job Result
Build 🧱 / macOS 🍏 (arm64) no diagnostic from rtmp-hevc.c.h (job still red — see below)
Build 🧱 / macOS 🍏 (x86_64) same
Analyze 🔬 / macOS 🍏 (clang-analyze) same

The unity group obs-outputs.hevc+.h.c now compiles on AppleClang; the jobs' remaining diagnostics name a different file, and the lane stays red for it:

plugins/obs-outputs/mp4-mux.c.h:524  implicit conversion loses integer precision: 'int' to 'uint8_t'
plugins/obs-outputs/mp4-mux.c.h:1119 implicit conversion changes signedness: 'int' to 'uint32_t'
plugins/obs-outputs/mp4-mux.c.h:1612 implicit conversion loses integer precision: 'int' to 'uint16_t' on negation

Those are master's own sites in a file this PR does not touch (filed as #2942), so this PR carries the HEVC record only and does not claim the lane is green.

Behaviour: a probe over all 65,536 (array_completeness, NAL_unit_type) pairs compares the old expression truncated by the uint8_t parameter with the cast expression — differing_bytes=0.

No flag, pin or target change; test/cmocka/, the record layout and the public headers are untouched. Tiers that do not apply: no Rust unit, C test or protocol-format change.

Notes

#2929 carried all three sites on 2026-10-29 and was closed; this is the one site that its landing in #2925 left behind.

)

`obs_parse_hevc_header()` assembles the NAL-array header byte from the
`array_completeness` and `NAL_unit_type` fields and hands the `int`
result to `s_w8()`, which takes a `uint8_t`. AppleClang's
`-Wimplicit-int-conversion` (part of the conversion ratchet #2872 added
for #2625) rejects it on the macOS lanes:

    rtmp-hevc.c.h:853:45: error: implicit conversion loses integer
    precision: 'int' to 'uint8_t' (aka 'unsigned char')
    [-Werror,-Wimplicit-int-conversion]

    s_w8(&s, (array->array_completeness << 7) |
              (array->NAL_unit_type & 0x3f));

#2925 stated the two sibling bytes in this function (the profile/tier byte
and the frame-rate byte); this is the third, the one the unity target
`obs-outputs.hevc+.h.c` reaches after them.

The cast states the truncation `s_w8()` already performed: the field
widths are 1 + 6 bits, so the low byte is the only byte the record ever
carried. Verified over all 65,536 `(array_completeness, NAL_unit_type)`
pairs — the old expression truncated by the `uint8_t` parameter and the
cast expression emit the same byte in every case.

RED: `clang -fsyntax-only` of `plugins/obs-outputs/build/obs-outputs.hevc+.h.c`
with the ratchet's conversion flags stops at line 853 with the diagnostic
above. GREEN: the same compile is clean.

Refs #2928

@zackees zackees left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: this change is already on master (redundant)

The one-line cast this PR adds is already in master. 985ccf278 — "build(obs-outputs): state the mp4-mux and rtmp-hevc conversions macOS clang reports (#2921) (#2922)", merged 2026-10-29 16:03 UTC — landed the rtmp-hevc conversions, including this exact site.

Evidence from the current master:

$ git show origin/master:plugins/obs-outputs/rtmp-hevc.c.h | sed -n '853p'
		s_w8(&s, (uint8_t)((array->array_completeness << 7) | (array->NAL_unit_type & 0x3f)));

That is byte-for-byte what this PR's 5c65e13af writes, so after a rebase onto master the PR's diff is empty. The issue it cites, #2928, is also already closed.

Branch is behind master

baseRefOid for this PR is 985ccf278, but the branch's merge base with master is 3682bdb50 (before #2922). Compared with current master the branch is missing #2922's mp4-mux changes:

$ git diff origin/master pr2941 --stat
 plugins/obs-outputs/mp4-mux.c.h    | 15 +++++++--------
 plugins/obs-outputs/mp4-output.c.h |  4 ++--

Nothing here changes behaviour or tests — it is purely a duplicate — but merging the branch as-is (rather than through a rebase) would undo the mp4-mux casts, so it should not be queued in this shape.

Recommendation

Close it as already fixed by #2922. If there is a remaining rtmp-hevc site that #2922 did not cover, it needs a fresh branch from current master so the diff shows what is actually left; I could not find one: all three sites in #2928 (827, 843, 853) carry the cast on master.

Unrelated: the red CEF Chromium Support check

The failure on this head is the nightly Compare the CEF pins with Chrome's extended stable step (run 40913129884, job 123586155321), not a build of this diff; it is the branch's scheduled dispatch and fails independently of the PR. Tracked by #1864 / #2418.

@zackees

zackees commented Oct 29, 2026

Copy link
Copy Markdown
Member Author

Superseded — this exact cast is already on master, so the PR diff is now empty.

985ccf278 (build(obs-outputs): state the mp4-mux and rtmp-hevc conversions macOS clang reports (#2921) (#2922)), merged 2026-10-29 16:03 UTC, states the same call site:

plugins/obs-outputs/rtmp-hevc.c.h:853
s_w8(&s, (uint8_t)((array->array_completeness << 7) | (array->NAL_unit_type & 0x3f)));

Nothing is lost: #2928's third byte landed there. Closing as redundant (coordinator, per docs/rust-port/coordination.md §6 — a superseded PR is closed with a link to the replacement). Rebasing onto current master would leave zero commits.

The Scheduled dispatch run on the branch (40913129884) also fails CEF Chromium Support 🌐 with the repo-wide pin alert ("macos-arm64: CEF 7871 is older than Chrome's extended stable (Chromium 156, branch 8078)"), which is unrelated to this diff and fails on master too — it needs its own fix, not this PR.

@zackees zackees closed this Oct 29, 2026
@zackees
zackees deleted the fix/2928-hevc-array-byte branch October 29, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug: obs-outputs: master's macOS build is still red in rtmp-hevc's HEVC record writer (#2625, #2872)

1 participant