Skip to content

build(ffmpeg-mux): ratchet the mux executable onto the conversion groups (#2625) - #3068

Merged
zackees merged 2 commits into
masterfrom
infra/2625-conversion-ffmpeg-mux
Oct 30, 2026
Merged

zackees merged 2 commits into
masterfrom
infra/2625-conversion-ffmpeg-mux

Conversation

@zackees

@zackees zackees commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Refs #2625 (slice: plugins/obs-ffmpeg/ffmpeg-mux).

The mux executable is the next target in the series that a Linux lane actually
compiles (obs-ffmpeg-mux is built by every Linux build; AJA and the optional
backends are not), so its opt-in is verifiable in this PR's own Sanitizers run.

RED

a7a0628fb names the three groups on obs-ffmpeg-mux instead of inheriting the
global -Wno-conversion / -Wno-sign-conversion / -Wno-float-conversion.
Replaying the target's core unity group with the lane's own toolchain
(gcc-toolset-14 14.2.1 in the obs-appimage-228 base image, /opt/obs-deps
ffmpeg 8 headers) reports 15 first-party diagnostics, all -Wsign-conversion,
all in ffmpeg-mux.c.h
(lines 374, 408, 428, 434, 461, 462, 517, 557, 747,
801, 820, 832, 837, 840, 1017), so the build stops.

GREEN

d281cdf58 states each conversion at its call site: the calloc track counts
and av_memdup header sizes as size_t (all already guarded non-negative),
nb_streams - 1, codec_tag and the HDR MaxCLL/MaxFALL fields as the
ffmpeg field types, the virtual-position math cast only at the int64_t
boundary (os_fseeki64, the seek result), and the two deque_push_back sizes
plus io_header.data_length as size_t.

Replayed with the groups on and -Werror: 15 -> 0 diagnostics, rc 0, for both
ffmpeg-mux.core+.h.c and ffmpeg-mux.posix+.h.c.

Measurement

  • uv run --no-project python -m unittest test_conversion_ratchet test_ci_scope
    in ci/: 61 tests, OK; the ratchet list gains plugins/obs-ffmpeg/ffmpeg-mux
    (30 -> 31 directories).
  • Build tooling only: no docs/features.md line, no new tests, no Test cost line.

…#2625)

RED: obs-ffmpeg-mux compiles its two unity groups with its own -Wconversion,
-Wsign-conversion and -Wfloat-conversion instead of inheriting the global -Wno-*
pins. Replaying the core unity TU on the lane's toolchain (gcc-toolset-14 14.2.1
in the AppImage base image, /opt/obs-deps ffmpeg headers) reports 15
first-party diagnostics, all sign conversions in ffmpeg-mux.c.h, so the build
stops.

Refs #2625
…2625)

GREEN for the target the previous commit enables the groups on. Every one of the
15 sites now states the conversion it already performed:

- the three `calloc` track counts and the two `av_memdup` header sizes are the
  `int` the params/header structs carry, made explicit as `size_t` at the call
  (each is guarded by a truthiness or `> 0` check first, so none is negative);
- `nb_streams - 1`, `codec_tag` and the two HDR `MaxCLL`/`MaxFALL` fields say
  their `int` as the `int`/`uint32_t`/`unsigned int` the ffmpeg field holds;
- the virtual-position math keeps `next_pos` unsigned and casts only at the
  `int64_t` boundary (`os_fseeki64`, the seek result), where the function's own
  bounds check has already proved the value non-negative;
- the two `deque_push_back` sizes and the `io_header.data_length` are the
  positive `buf_size` as `size_t`.

Replayed with the groups on and `-Werror`: 15 -> 0 diagnostics, rc 0, for both
`ffmpeg-mux.core+.h.c` and `ffmpeg-mux.posix+.h.c` on the lane's own toolchain
(gcc-toolset-14 14.2.1, `/opt/obs-deps` ffmpeg 8 headers).

Refs #2625

@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.

Coordinator review: LGTM. RED is the 15 measured -Wsign-conversion diagnostics with the lane's own toolchain, and GREEN takes them to 0 under -Werror for both unity groups. Every cast spells out the conversion the code already did implicitly, so behaviour is unchanged. That includes next_pos = (uint64_t)position, which keeps the old wrap if position were ever negative. That is worth a separate look some day, but it isn't this PR's job. Unlike the last few slices, this target is compiled by every Linux build, so the PR's own Sanitize run verifies it. Queue on green.

@zackees

zackees commented Oct 30, 2026

Copy link
Copy Markdown
Member Author

Handed off to the coordinator: CI is green on d281cdf58 (15 pass, 26 skipped — including the Sanitizers asan lane, which is the one ci/ci_scope.py selects for this PR because the CMakeLists now names a conversion group), and the PR is queued to merge. Ratchet + scope tests: 61, OK locally. Local ./lint cannot complete on this host (its lane container has no git on PATH, so ci/check_changes.py exits early); the workflow lanes are the gate.

With this slice and #3067 merged, every conversion-ratchet target that a Linux lane compiles is opted in; the remaining directories are platform-only (ENABLE_AJA=OFF, ENABLE_LIBFDK=OFF, macOS/Windows targets) or INTERFACE libraries whose sources compile in their consumers.

Merged via the queue into master with commit f1e3fbb Oct 30, 2026
41 checks passed
@zackees
zackees deleted the infra/2625-conversion-ffmpeg-mux branch October 30, 2026 14:06
@obs-rust-project-manager obs-rust-project-manager Bot moved this from In review to Done in obs-rust Multiview Oct 30, 2026
MCPVOT pushed a commit to MCPVOT/obs-studio that referenced this pull request Oct 30, 2026
…ports (obs-rust#3089) (obs-rust#3090)

obs-rust#3068 ratcheted obs-ffmpeg-mux onto -Wconversion/-Wsign-conversion and
replayed both unity TUs with gcc-toolset-14, where these five sites are
silent. AppleClang gives int -> enum conversions the enum's underlying
type, which is unsigned int for every AVColor* enum, so the macOS app
build fails on them and the daily beta has been red since obs-rust#3068 landed
(run 41083530569, job 124158735150).

The fields arrive as the int the command line carries; the cast states
the conversion the code already performed. No behaviour change.

RED (local, clang 21, ffmpeg 8 headers, -Werror):
  ffmpeg-mux.core+.h.c: 5 errors, lines 440-444
GREEN: both unity TUs, clang and gcc, 0 diagnostics.

Refs obs-rust#2625, obs-rust#3068
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.

1 participant