Skip to content

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

Closed

Description

@zackees

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.

Activity

  1. added
    bug
    ready
    P1
    on Oct 29, 2026
  2. zackees commented on Oct 29, 2026

    @zackees
    MemberAuthor

    Claiming: the rtmp-hevc record conversions

    1. RED: the dispatched scheduled.yaml run 40890899955 on branch fix/2921-mp4-mux-conversions already fails the three macOS jobs in this file, on master code; recorded in the issue.
    2. GREEN: state the three conversions at the s_w8 call sites in plugins/obs-outputs/rtmp-hevc.c.h, checked against the old expressions byte-for-byte, then a workflow_dispatch of scheduled.yaml on the branch with arm64, x86_64 and clang-analyze green.
    3. ./lint, PR against master (Refs #2928), hand off at the merge queue.

    First PR today.

  3. zackees commented on Oct 29, 2026

    @zackees
    MemberAuthor

    Progress: branch fix/2928-rtmp-hevc-conversions, PR #2929 (draft). Three casts in, ./lint clean, 640-combination probe shows identical bytes, local clang RED 3/3 -> GREEN. The macOS dispatch on that branch compiles obs-outputs.hevc+.h.c with no diagnostics; the lane stays red only on mp4-mux until #2922 lands, so full green evidence comes after a rebase onto it.

  4. zackees commented on Oct 29, 2026

    @zackees
    MemberAuthor

    Status after today's merges, so this does not look stalled:

    I closed #2929 as superseded (it was a subset of #2925 + #2922). Nothing else is queued against this file.

  5. zackees commented on Oct 29, 2026

    @zackees
    MemberAuthor

    Status: rtmp-hevc.c.h 827 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 two s_w8()
    arguments. Only line 853 ((uint8_t)((array->array_completeness << 7) | ...), clang-only: gcc's
    -Wconversion folds 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).

  6. zackees commented on Oct 29, 2026

    @zackees
    MemberAuthor

    All three casts in plugins/obs-outputs/rtmp-hevc.c.h are 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.c with no diagnostics; the app build's remaining red is #2938's frontend conversions.

  7. zackees commented on Oct 29, 2026

    @zackees
    MemberAuthor

    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 one obs-outputs.hevc+.h.c reaches next.

    Plan:

    1. PR build(obs-outputs): state the HEVC record's array-byte conversion (#2928) #2941 (fix/2928-hevc-array-byte): the (uint8_t) cast at 853, with local RED/GREEN clang -fsyntax-only of 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.
    2. Evidence for the macOS lanes: a scheduled.yaml workflow_dispatch on that branch, since a PR run does not select the macOS app build for a plugins/obs-outputs path.

    First PR expected: #2941, up now.

  8. github-actions commented on Oct 29, 2026

    @github-actions

    Claim bot: @zackees, this issue is closed; reopen it first if work remains.

  9. zackees commented on Oct 29, 2026

    @zackees
    MemberAuthor

    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:

    clang -fsyntax-only -std=gnu17 -DENABLE_HEVC [includes] \
      -Wconversion -Wsign-conversion -Wfloat-conversion -Werror \
      plugins/obs-outputs/build/obs-outputs.hevc+.h.c      # rc=0
      plugins/obs-outputs/build/obs-outputs.mp4-mux+.h.c   # rc=0

    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 before 985ccf278 merged 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.

  10. moved this from In progress to Done in obs-rust Multiviewon Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1bugready

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions