Commit 75fb07a6d282ac0b3a9b51dd8cb48a6ef72b8b29

Alex Szpakowski 2017-05-03T18:05:29

iOS: Only mark interrupted audio devices as non-interrupted if AudioQueueStart is successful.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/audio/coreaudio/SDL_coreaudio.m b/src/audio/coreaudio/SDL_coreaudio.m
index 485d86d..32b9d9b 100644
--- a/src/audio/coreaudio/SDL_coreaudio.m
+++ b/src/audio/coreaudio/SDL_coreaudio.m
@@ -285,9 +285,9 @@ static void interruption_begin(_THIS)
 static void interruption_end(_THIS)
 {
     if (this != NULL && this->hidden != NULL && this->hidden->audioQueue != NULL
-    && this->hidden->interrupted) {
+    && this->hidden->interrupted
+    && AudioQueueStart(this->hidden->audioQueue, NULL) == AVAudioSessionErrorCodeNone) {
         this->hidden->interrupted = SDL_FALSE;
-        AudioQueueStart(this->hidden->audioQueue, NULL);
     }
 }