mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-22 16:24:04 +02:00
Core Audio: Stop the device when interruption_began is posted.
Public issue https://github.com/mackron/miniaudio/issues/400
This commit is contained in:
+11
@@ -32520,6 +32520,17 @@ static ma_result ma_device__untrack__coreaudio(ma_device* pDevice)
|
||||
case AVAudioSessionInterruptionTypeBegan:
|
||||
{
|
||||
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);
|
||||
} break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user