Skip to content

obs-transitions: Fade to Color switch point 0%/100% no longer yields NaN audio - #687

Merged
zackees merged 3 commits into
masterfrom
fix/488-fade-to-color-nan
Oct 14, 2026
Merged

zackees merged 3 commits into
masterfrom
fix/488-fade-to-color-nan

Conversation

@zackees

@zackees zackees commented Oct 14, 2026

Copy link
Copy Markdown
Member

Fixes #488

Fade to Color with a switch point of 0% or 100% divided by zero in smoothstep(min, max, x) (max == min), giving NaN/inf audio gains. A zero-width ramp is now a step, so at 0% the outgoing source is silent immediately and at 100% the incoming source starts only at the end.

Commits: RED 32fdd26 (behavior-neutral extraction of the gain math into fade-to-color-mix.h + new test_fade_to_color_mix), GREEN 0312a1c (fix). Local gate stamped.

RED (Tier 2, run.sh, 4 of 5 tests fail on the unfixed math):

[   LINE   ] --- ../../src/test/cmocka/test_fade_to_color_mix.c:19: error: Failure!
[  FAILED  ] test_switch_point_zero_finite
[   LINE   ] --- ../../src/test/cmocka/test_fade_to_color_mix.c:20: error: Failure!
[  FAILED  ] test_switch_point_one_finite
[   LINE   ] --- ../../src/test/cmocka/test_fade_to_color_mix.c:42: error: Failure!
[  FAILED  ] test_switch_point_zero_switches_immediately
[   LINE   ] --- ../../src/test/cmocka/test_fade_to_color_mix.c:55: error: Failure!
[  FAILED  ] test_switch_point_one_switches_at_end
[  FAILED  ] tests: 4 test(s), listed below:
[  FAILED  ] test_switch_point_zero_finite
[  FAILED  ] test_switch_point_one_finite
[  FAILED  ] test_switch_point_zero_switches_immediately
[  FAILED  ] test_switch_point_one_switches_at_end
 4 FAILED TEST(S)

GREEN (rust/tools/linux-validate/run.sh): test_fade_to_color_mix Passed in both OFF and ON; "100% tests passed, 0 tests failed out of 195" (both); libobs exported symbols IDENTICAL (1766). ./lint ok.

Video rendering is untouched (the unused sa value at 0% was the only NaN-prone value there). Credit: chriscoveries' fork branch was offered but written fresh.

@zackees zackees added the ci-full Run every CI job on this PR, including the release-gating OBS app builds and Flatpak label Oct 14, 2026
Factors the gain math into fade-to-color-mix.h (behavior-neutral) and adds
test_fade_to_color_mix. Refs #488.
Switch points of 0% and 100% divided by zero and produced NaN audio gains.
Fixes #488.

Local-Gate: v1 tree=46275812537035705f2baf2afda21c57bba1f53a secs=458 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run
Ci-Attestation: {"at":1791959367,"gate":"rust/all/fmt","host":"linux-x86_64","key":"3f8fe24072a1f7dca78418b32724f231336f5e1c648852d32d49678dae83adf5","lane":"lint","parents":["32fdd261894410ca3d96f1ceb06dbc27279a2b7d"],"secs":46,"stamp":"c1c0d3e85a198ac240d1fbc391ec4660","tree":"46275812537035705f2baf2afda21c57bba1f53a","v":1,"via":"run"}
Ci-Attestation: {"at":1791959367,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"3f8fe24072a1f7dca78418b32724f231336f5e1c648852d32d49678dae83adf5","lane":"lint","parents":["32fdd261894410ca3d96f1ceb06dbc27279a2b7d"],"secs":46,"stamp":"fb6c54edfa52ab315a9012f6da213d0f","tree":"46275812537035705f2baf2afda21c57bba1f53a","v":1,"via":"run"}
Ci-Attestation: {"at":1791959367,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"b41146a3d3fe506ef0d9d037bb28fe29585148cdbb9aa3ab280ebccef5b9b897","lane":"rust-test","parents":["32fdd261894410ca3d96f1ceb06dbc27279a2b7d"],"secs":156,"stamp":"bf5118aa4f3e14a42cd5064bd83f2866","tree":"46275812537035705f2baf2afda21c57bba1f53a","v":1,"via":"run"}
Ci-Attestation: {"at":1791959367,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"01b999fe10f75083fa3eba062bd669d7cb43b27dbe34279bd5ebc7ca759cc2d7","lane":"cross","parents":["32fdd261894410ca3d96f1ceb06dbc27279a2b7d"],"secs":109,"stamp":"025064b396edaacf5a83cac7083f9c31","tree":"46275812537035705f2baf2afda21c57bba1f53a","v":1,"via":"run"}
Ci-Attestation: {"at":1791959367,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"01b999fe10f75083fa3eba062bd669d7cb43b27dbe34279bd5ebc7ca759cc2d7","lane":"cross","parents":["32fdd261894410ca3d96f1ceb06dbc27279a2b7d"],"secs":109,"stamp":"ca54061ae1f30569d51e09e4be880647","tree":"46275812537035705f2baf2afda21c57bba1f53a","v":1,"via":"run"}
Ci-Attestation: {"at":1791959367,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"01b999fe10f75083fa3eba062bd669d7cb43b27dbe34279bd5ebc7ca759cc2d7","lane":"cross","parents":["32fdd261894410ca3d96f1ceb06dbc27279a2b7d"],"secs":109,"stamp":"dfa13bf6930d0b558ef94253134dc292","tree":"46275812537035705f2baf2afda21c57bba1f53a","v":1,"via":"run"}
Ci-Attestation: {"at":1791959367,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"01b999fe10f75083fa3eba062bd669d7cb43b27dbe34279bd5ebc7ca759cc2d7","lane":"cross","parents":["32fdd261894410ca3d96f1ceb06dbc27279a2b7d"],"secs":109,"stamp":"d98ee9d30ebbf549c0429b659652f658","tree":"46275812537035705f2baf2afda21c57bba1f53a","v":1,"via":"run"}
Ci-Attestation: {"at":1791959367,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"01b999fe10f75083fa3eba062bd669d7cb43b27dbe34279bd5ebc7ca759cc2d7","lane":"cross","parents":["32fdd261894410ca3d96f1ceb06dbc27279a2b7d"],"secs":109,"stamp":"ac9031b70aee9dfb46473d9fac0bb280","tree":"46275812537035705f2baf2afda21c57bba1f53a","v":1,"via":"run"}
Ci-Attestation: {"at":1791959367,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"01b999fe10f75083fa3eba062bd669d7cb43b27dbe34279bd5ebc7ca759cc2d7","lane":"cross","parents":["32fdd261894410ca3d96f1ceb06dbc27279a2b7d"],"secs":109,"stamp":"f294f23ed9761ade424ed9426f8ade98","tree":"46275812537035705f2baf2afda21c57bba1f53a","v":1,"via":"run"}
Ci-Attestation: {"at":1791959367,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"68f7b4dedcd68d9f29390fd681a163f5950c5746451a3270f1c1aea194b2927c","lane":"tier2-linux","parents":["32fdd261894410ca3d96f1ceb06dbc27279a2b7d"],"secs":147,"stamp":"40d0065b6c800f777ca2a883d487893c","tree":"46275812537035705f2baf2afda21c57bba1f53a","v":1,"via":"run"}
MSVC has no m.lib (LNK1104 on Rust Tier 2 Windows, run 38522525850).

Local-Gate: v1 tree=e44b6db399f58469cf9600347b3fb262fbb227b4 secs=445 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run
Ci-Attestation: {"at":1791961099,"gate":"rust/all/fmt","host":"linux-x86_64","key":"7750ea59cbaf6449b28576fe67da161417c1fc60013cdbee128af2c60ddb8769","lane":"lint","parents":["bd957c476ab8d5f5fa41f7dc5063efa0d5ec677a"],"secs":53,"stamp":"a68c70cddd76d91ceb44ffe7f2af4ac1","tree":"e44b6db399f58469cf9600347b3fb262fbb227b4","v":1,"via":"run"}
Ci-Attestation: {"at":1791961099,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"7750ea59cbaf6449b28576fe67da161417c1fc60013cdbee128af2c60ddb8769","lane":"lint","parents":["bd957c476ab8d5f5fa41f7dc5063efa0d5ec677a"],"secs":53,"stamp":"eb47714d3d42446d994712d1032b0d7b","tree":"e44b6db399f58469cf9600347b3fb262fbb227b4","v":1,"via":"run"}
Ci-Attestation: {"at":1791961099,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"86d2d337eec06904338ce50d397b6af290094d8c8c9d9b24ba1d3d410b8dfc52","lane":"rust-test","parents":["bd957c476ab8d5f5fa41f7dc5063efa0d5ec677a"],"secs":140,"stamp":"e18fd91ec3c12661301b6e198d9eac48","tree":"e44b6db399f58469cf9600347b3fb262fbb227b4","v":1,"via":"run"}
Ci-Attestation: {"at":1791961099,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"4d40a447a421632c3355872b5e5b5181528ecf16a2aa83ccb2015b14c041f10a","lane":"cross","parents":["bd957c476ab8d5f5fa41f7dc5063efa0d5ec677a"],"secs":103,"stamp":"b8d60f8933dba339599171b85438dc2a","tree":"e44b6db399f58469cf9600347b3fb262fbb227b4","v":1,"via":"run"}
Ci-Attestation: {"at":1791961099,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"4d40a447a421632c3355872b5e5b5181528ecf16a2aa83ccb2015b14c041f10a","lane":"cross","parents":["bd957c476ab8d5f5fa41f7dc5063efa0d5ec677a"],"secs":103,"stamp":"5e7c3eb453408d1c7c66f4fc6a6995fb","tree":"e44b6db399f58469cf9600347b3fb262fbb227b4","v":1,"via":"run"}
Ci-Attestation: {"at":1791961099,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"4d40a447a421632c3355872b5e5b5181528ecf16a2aa83ccb2015b14c041f10a","lane":"cross","parents":["bd957c476ab8d5f5fa41f7dc5063efa0d5ec677a"],"secs":103,"stamp":"96a7c0700d8a8edf833df15db7b39047","tree":"e44b6db399f58469cf9600347b3fb262fbb227b4","v":1,"via":"run"}
Ci-Attestation: {"at":1791961099,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"4d40a447a421632c3355872b5e5b5181528ecf16a2aa83ccb2015b14c041f10a","lane":"cross","parents":["bd957c476ab8d5f5fa41f7dc5063efa0d5ec677a"],"secs":103,"stamp":"c66efd6fbea82f61b29e726f1988cfd5","tree":"e44b6db399f58469cf9600347b3fb262fbb227b4","v":1,"via":"run"}
Ci-Attestation: {"at":1791961099,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"4d40a447a421632c3355872b5e5b5181528ecf16a2aa83ccb2015b14c041f10a","lane":"cross","parents":["bd957c476ab8d5f5fa41f7dc5063efa0d5ec677a"],"secs":103,"stamp":"39e0aab6a1a55c5ce736819c694ce20f","tree":"e44b6db399f58469cf9600347b3fb262fbb227b4","v":1,"via":"run"}
Ci-Attestation: {"at":1791961099,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"4d40a447a421632c3355872b5e5b5181528ecf16a2aa83ccb2015b14c041f10a","lane":"cross","parents":["bd957c476ab8d5f5fa41f7dc5063efa0d5ec677a"],"secs":103,"stamp":"7e3f8095e92b05befb66685371d9c280","tree":"e44b6db399f58469cf9600347b3fb262fbb227b4","v":1,"via":"run"}
Ci-Attestation: {"at":1791961099,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"3f735b4d41102e5db068edd2678d20abdaad107cba777dd70c3142d20bc72475","lane":"tier2-linux","parents":["bd957c476ab8d5f5fa41f7dc5063efa0d5ec677a"],"secs":150,"stamp":"a328600d729057f95d7e15b9809eff97","tree":"e44b6db399f58469cf9600347b3fb262fbb227b4","v":1,"via":"run"}
@zackees
zackees force-pushed the fix/488-fade-to-color-nan branch from 0312a1c to ffa8368 Compare October 14, 2026 06:58
@zackees

zackees commented Oct 14, 2026

Copy link
Copy Markdown
Member Author

Rust Tier 2 Windows failed to link the new test: LNK1104: cannot open file 'm.lib' (run 38522525850). The test linked m unconditionally, and MSVC has no libm. It now links m only if(NOT MSVC), like test_bounds and test_graphics_alias_rest. Rebased onto master, local gate stamped.

@zackees
zackees merged commit 2537234 into master Oct 14, 2026
24 checks passed
@zackees
zackees deleted the fix/488-fade-to-color-nan branch October 26, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-full Run every CI job on this PR, including the release-gating OBS app builds and Flatpak

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug: obs-transitions: Fade to Color with a switch point of 0% or 100% produces NaN audio

1 participant