You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rust/obs-media-io: move audio_io.rs unsafe out of the safe core into src/ffi #294
#290 denies unsafe_code in the port crates, allowing it only in src/ffi/ and at documented C boundaries. The audio-io port (#289) merged just before it, with 54unsafe sites in rust/obs-media-io/src/audio_io.rs. They implement the raw-pointer "unsafe lifetime contract" API that the C shims drive, plus the audio thread's shared-state cells.
To land #290 without blocking on a large refactor of a brand-new port, mod audio_io carries a module-level #[allow(unsafe_code)] that points here. This issue tracks removing it:
Move the raw-API surface (the pointer-taking functions and their unsafe contracts) into src/ffi/audio_io.rs, so audio_io.rs exposes only a safe owned API.
Keep the shared-state synchronization in safe primitives where possible. Any unsafe that must stay needs its own justified, item-level #[allow(unsafe_code)].
RED: drop the module-level allow, so the build fails with 54 unsafe_code errors. GREEN: it builds with only src/ffi and item-level allows, and audio_io, audio_io_core, audio_io_parity and Tier 2 test_audio_io (OFF and ON) still pass.
Claiming: #294. Plan: 1) RED: drop the module-level allow on mod audio_io; 2) GREEN: move the raw-pointer API and the audio thread's shared-state cells out of audio_io/port.rs (since #326) into src/ffi/audio_io.rs, leaving item-level allows only where the C callback contract needs them; 3) the audio_io tests and Tier 2 pass OFF/ON. One PR today.
Activity
obs-media-io: Allow unsafe in audio_io until obs-rust#294
zackees commentedon Oct 12, 2026
Claiming: #294. Plan: 1) RED: drop the module-level allow on
mod audio_io; 2) GREEN: move the raw-pointer API and the audio thread's shared-state cells out ofaudio_io/port.rs(since #326) intosrc/ffi/audio_io.rs, leaving item-level allows only where the C callback contract needs them; 3) the audio_io tests and Tier 2 pass OFF/ON. One PR today.obs-media-io: Drop the module-level unsafe_code allow on audio_io (RED)
obs-media-io: Move the audio-io engine into src/ffi (GREEN)