mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 14:20:42 -07:00
3037214932
Add a timeout and skip signalling to the D3D9 capture path so the API thread no longer waits indefinitely when Present stops during loading. Return the last successful JPEG frame as a fallback. ## Link to GitHub Issue or related Pull Request, if one exists #746 ## Description of change * Fix `capture.get_jpg` blocking indefinitely when D3D9 screen capture cannot complete during game loading (e.g. no Present calls). * Add a 2-second timeout to `graphics_capture_receive_jpeg()` and cancel pending capture requests on timeout. * Signal capture skip from D3D9 failure paths via `graphics_capture_skip()`. * Cache the last successful JPEG per screen and return it as a fallback when a new capture fails. Tested with **stock iOS Spice Companion** only. I have not tested Android or other Companion clients. The iOS client implementation differs from the others; this fix is server-side only. No config file, CLI option, or API schema changes. ## Testing * Built locally with llvm-mingw cross-compiler (WSL). * Docker build (`src/spice2x/build_docker.sh`): Pending * Tested with stock iOS Spice Companion on iPad: Mirror remains connected during game loading instead of returning to KeyPad.