forked from sox_ng/sox_ng
The driver can return MMSYSERR_STILLPLAYING when closing a device. The old stop function ignores that result; format teardown then releases ft->priv even though its embedded WAVEHDRs can remain driver-owned. Check reset, unprepare and close results on both input and output. On a failed device close, detach the private allocation from ft so the generic format cleanup cannot release the live headers, data or callback event. On successful close, release them normally. The failure path intentionally retains storage for the remaining process lifetime instead of risking use-after-free. Extend the WinMM teardown simulation to cover close refusal, reset and wait failures, header unprepare failures, timer rollover and the input close path. Actual Windows device playback remains unverified. |
||
|---|---|---|
| .. | ||
| run | ||
| winmm-driver.c | ||