Repository navigation
build(ffmpeg-mux): ratchet the mux executable onto the conversion groups (#2625) - #3068
Conversation
…#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
left a comment
There was a problem hiding this comment.
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.
|
Handed off to the coordinator: CI is green on With this slice and #3067 merged, every conversion-ratchet target that a Linux lane compiles is opted in; the remaining directories are platform-only ( |
…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
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-muxis built by every Linux build; AJA and the optionalbackends are not), so its opt-in is verifiable in this PR's own Sanitizers run.
RED
a7a0628fbnames the three groups onobs-ffmpeg-muxinstead of inheriting theglobal
-Wno-conversion/-Wno-sign-conversion/-Wno-float-conversion.Replaying the target's core unity group with the lane's own toolchain
(
gcc-toolset-1414.2.1 in theobs-appimage-228base image,/opt/obs-depsffmpeg 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
d281cdf58states each conversion at its call site: thecalloctrack countsand
av_memdupheader sizes assize_t(all already guarded non-negative),nb_streams - 1,codec_tagand the HDRMaxCLL/MaxFALLfields as theffmpeg field types, the virtual-position math cast only at the
int64_tboundary (
os_fseeki64, the seek result), and the twodeque_push_backsizesplus
io_header.data_lengthassize_t.Replayed with the groups on and
-Werror: 15 -> 0 diagnostics, rc 0, for bothffmpeg-mux.core+.h.candffmpeg-mux.posix+.h.c.Measurement
uv run --no-project python -m unittest test_conversion_ratchet test_ci_scopein
ci/: 61 tests, OK; the ratchet list gainsplugins/obs-ffmpeg/ffmpeg-mux(30 -> 31 directories).
docs/features.mdline, no new tests, no Test cost line.