DescriptionFixed NO_DATA_ERROR on Mac.
I wrote two unittests which open the device, wait for the data callback, then close the device, ran the tests in an infinite loop, after several hours, it hits NO_MIC_DATA on the input side. The problem is that sometimes the audio unit gets corrupted, and our input code does not correctly dispose the unit component, so the broken audio unit can be leaked and prevent the OS pumping audio callback to all auido units.
This patch fixes two problems:
1, AUAudioInputStream::Close() is not completely correct, we need to call AudioComponentInstanceDispose()
2, It seems that we should setup the input callback before setting the formats, which might not be correct (I am not really sure, but the tests show that I was able to restart the stream after changing it)
BUG=411869
Committed: https://crrev.com/9bb4136278a98e27d1c47e97fb3a4f496a97ca8c
Cr-Commit-Position: refs/heads/master@{#293725}
Patch Set 1 #
Messages
Total messages: 7 (2 generated)
|