mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-11-22 08:17:28 +00:00
The buffer completion callback read `engine.isRunning` on the AVAudioPlayerNode completion queue. `AVAudioPlayerNode.stop()` holds the engine lock while it waits synchronously for that queue, so a main-thread stop (category-escalation rebuild, teardown) deadlocked and the watchdog killed the app (0x8BADF00D). Seen on device when opening the video camera while a live stream's audio was playing. Classify completions on a private serial queue instead, so the node's completion queue never touches the engine. (cherry picked from commit bf1e1e70b290e4c7701002e69a5dbe49349f8b82)