1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-01 03:10:06 +00:00

Moved iOS stream format changes to the message thread

This commit is contained in:
tpoole 2017-03-07 17:12:51 +00:00
parent 9c75f13a4f
commit d8504a6090

View file

@ -647,8 +647,8 @@ public:
kAudioUnitScope_Global, 0, &connected, &dataSize);
jassert (err == noErr);
JUCE_IOS_AUDIO_LOG ("handleInterAppAudioConnectionChange: " << connected ? "connected"
: "disconnected");
JUCE_IOS_AUDIO_LOG ("handleInterAppAudioConnectionChange: " << (connected ? "connected"
: "disconnected"));
if (connected != owner.interAppAudioConnected)
{
@ -967,13 +967,21 @@ private:
&dataSize);
if (desc.mSampleRate != owner.getCurrentSampleRate())
{
owner.updateSampleRateAndAudioInput();
const ScopedLock sl (callbackLock);
if (owner.callback != nullptr)
struct RouteChangeMessage : public CallbackMessage
{
owner.callback->audioDeviceStopped();
owner.callback->audioDeviceAboutToStart (&owner);
}
RouteChangeMessage (iOSAudioIODevice& dev)
: device (dev)
{}
void messageCallback() override
{
device.handleRouteChange ("Stream format change");
}
iOSAudioIODevice& device;
};
(new RouteChangeMessage (owner))->post();
}
}