mozilla / cubeb

Cross platform audio library
ISC License
440 stars 124 forks source link

When using AAudio, reinitialize the stream if a the device in use is disconnected #752

Closed padenot closed 1 year ago

padenot commented 1 year ago

and other cleanups (clang tidy, format).

The important parts are cb626a421b3ab55114914c25e9a80d69fe1a96ad and cb626a421b3ab55114914c25e9a80d69fe1a96ad, the rest is just cleanups and also the ability to log without changing a #define. Hopefully the messages are clear enough to understand what's going on, despite the long commits.

This fixes BMO#1841876.

Some bits of the doc that are useful:

https://developer.android.com/ndk/reference/group/audio#aaudiostream_errorcallback (what can one do or shouldn't do within the error callback) https://developer.android.com/ndk/reference/group/audio#aaudiostreambuilder_seterrorcallback (explaining what we're doing here -- largely similar to what we do on other backends). https://developer.android.com/ndk/guides/audio/aaudio/aaudio#disconnected-streams

This also changes the build to use C++17, so it match what Gecko uses. It also update googletest, so it works compiles in C++17.