I’ve observed some crash reports on Android that involved this call, which I can not reproduce:
backtrace:
#00 pc 0x0000000000475770 /data/app/~~K7-4Sf8iHmKX6scDPKXn6g==/a.b.c-hb26sPdehZJrArOjYd86MA==/split_config.arm64_v8a.apk!libA.so (juce::AudioDeviceManager::setAudioDeviceSetup(juce::AudioDeviceManager::AudioDeviceSetup const&, bool)+808) (BuildId: 535d2225689673991703f50b162c09bada7b1820)
#01 pc 0x000000000047420c /data/app/~~K7-4Sf8iHmKX6scDPKXn6g==/a.b.c-hb26sPdehZJrArOjYd86MA==/split_config.arm64_v8a.apk!libA.so (juce::AudioDeviceManager::initialiseDefault(juce::String const&, juce::AudioDeviceManager::AudioDeviceSetup const*)+400) (BuildId: 535d2225689673991703f50b162c09bada7b1820)
#02 pc 0x0000000000475d68 /data/app/~~K7-4Sf8iHmKX6scDPKXn6g==/a.b.c-hb26sPdehZJrArOjYd86MA==/split_config.arm64_v8a.apk!libA.so (juce::AudioDeviceManager::initialiseWithDefaultDevices(int, int)+322) (BuildId: 535d2225689673991703f50b162c09bada7b1820)
#03 pc 0x0000000000439864 /data/app/~~J6t7VPxYh9QCpPhmIrdOZA==/a.b.c-Q-6Rip_X2LhXnIi5DhsmUA==/split_config.arm64_v8a.apk!libA.so (MediaPlayer::reInitDevice()+755) (BuildId: 535d2225689673991703f50b162c09bada7b1820)
And here’s my code:
void MediaPlayer::reInitDevice() {
pause();
deviceManager->removeAudioCallback(&player);
deviceManager->closeAudioDevice();
deviceManager = make_unique<AudioDeviceManager>();
deviceManager->addAudioCallback(&player);
deviceManager->initialiseWithDefaultDevices(0, 2);
}
I could not think of any reason that cause this crash. Appreciate any help