ao_coreaudio: cleanup ao on init failure - #18383
Conversation
|
The fix passed my testing. I do not have a macOS 27 setup. This testing was done under macOS 15.7.9 using mpv master @ 02a595d. To reproduce the crash I added the following statement to the initializer in ao_coreaudio.c: goto coreaudio_error;right before: reinit_latency(ao);In order to simulate a driver failure. I built mpv with The addition of the I powered on my AirPods Max to trigger a hotplug event. When the AirPods connected mpv crashed due to the address sanitizer detecting a heap buffer overflow. Details can be seen in the terminal session: Terminal session:I then repeated the test, this time patching ao_coreaudio.c with the fix in this PR and then adding the As before the addition of the This time when I connected my AirPods Max mpv successfully handled the hotplug even and changed the audio to the AirPods: Terminal session:Full logs and the crash report: To test that Changes look good to me. |
This matches what other AOs and VOs do and properly releases allocated resources on failure.
No real point in registering the hotplug if we don't even know if the actual ao is going to work or not yet. Just move it down.
92ab324 to
3371b90
Compare
|
Thanks for testing. Rebased on master with the fixed macos CI |
This matches what other AOs and VOs do and properly releases allocated resources on failure.
Can someone actually verify that my assumptions in the uninit are correct since I'm not a mac user.