Commit aa983db0 authored by David Reid's avatar David Reid

Core Audio: Stop the device when interruption_began is posted.

Public issue https://github.com/mackron/miniaudio/issues/400
parent 99d37184
...@@ -32520,6 +32520,17 @@ static ma_result ma_device__untrack__coreaudio(ma_device* pDevice) ...@@ -32520,6 +32520,17 @@ static ma_result ma_device__untrack__coreaudio(ma_device* pDevice)
case AVAudioSessionInterruptionTypeBegan: case AVAudioSessionInterruptionTypeBegan:
{ {
ma_log_postf(ma_device_get_log(m_pDevice), MA_LOG_LEVEL_INFO, "[Core Audio] Interruption: AVAudioSessionInterruptionTypeBegan\n"); ma_log_postf(ma_device_get_log(m_pDevice), MA_LOG_LEVEL_INFO, "[Core Audio] Interruption: AVAudioSessionInterruptionTypeBegan\n");
/*
Core Audio will have stopped the internal device automatically, but we need explicitly
stop it at a higher level to ensure miniaudio-specific state is updated for consistency.
*/
ma_device_stop(m_pDevice);
/*
Fire the notification after the device has been stopped to ensure it's in the correct
state when the notification handler is invoked.
*/
ma_device__on_notification_interruption_began(m_pDevice); ma_device__on_notification_interruption_began(m_pDevice);
} break; } break;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment