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
bug: libobs: obs_wait_for_destroy_queue skips the video thread when audio is not reset (flaky lifetime tests) #5405
The video thread waits only when audio was reset as well. tick_sources() (libobs/obs-video.c.h:47) takes a reference on every source, private ones included, while it ticks it. A caller that runs video without audio, releases a source, waits for the destroy queue and then checks a weak reference can still see the tick's reference.
26 cmocka fixtures reset video without audio and call obs_wait_for_destroy_queue(). One of them failed the master push run of #5356 (Rust Tier 2 Linux, tests OFF): test_scene_item_transition_serialization_lifetime.c:107: obs_weak_source_expired(old) is not true (https://github.com/obs-rust/obs-studio/actions/runs/44895576535). The test did not change in that merge.
A real OBS session always resets audio, so users don't hit this. It shows up as flaky tests.
Proposed fix and failing test
Wait for the graphics task whenever the video thread runs, and for the audio task whenever audio exists, as two separate checks.
RED: a new cmocka test, test_destroy_queue_video_sync, resets video only. A private source's video_tick blocks while the test releases its own reference, and the test then asserts that the weak reference has expired after obs_wait_for_destroy_queue(). Before the fix the assertion fails every time; after it, it passes.
Claiming: red master fix. RED test written and failing locally (Tier 2 linux-validate: test_destroy_queue_video_sync.c:107: obs_weak_source_expired(weak) is not true); PR follows.
Activity
rdoupe commentedon Nov 21, 2026
Claiming: red master fix. RED test written and failing locally (Tier 2 linux-validate:
test_destroy_queue_video_sync.c:107: obs_weak_source_expired(weak) is not true); PR follows.libobs: wait for the video thread in obs_wait_for_destroy_queue witho…