Title: [273172] branches/safari-611-branch/Source/WebCore
Revision
273172
Author
alanc...@apple.com
Date
2021-02-19 15:37:46 -0800 (Fri, 19 Feb 2021)

Log Message

Cherry-pick r272913. rdar://problem/74500965

    AVAudioSessionCaptureDeviceManager should disable its audio session in a background thread
    https://bugs.webkit.org/show_bug.cgi?id=221949
    <rdar://problem/74315824>

    Reviewed by Eric Carlson.

    Manually tested.

    * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
    (WebCore::AVAudioSessionCaptureDeviceManager::disableAllDevicesQuery):
    Hop to a background thread before disabling the audio session.
    Abort if audio session is no longer marked as unneeded.

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272913 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-611-branch/Source/WebCore/ChangeLog (273171 => 273172)


--- branches/safari-611-branch/Source/WebCore/ChangeLog	2021-02-19 23:37:42 UTC (rev 273171)
+++ branches/safari-611-branch/Source/WebCore/ChangeLog	2021-02-19 23:37:46 UTC (rev 273172)
@@ -1,5 +1,40 @@
 2021-02-19  Alan Coon  <alanc...@apple.com>
 
+        Cherry-pick r272913. rdar://problem/74500965
+
+    AVAudioSessionCaptureDeviceManager should disable its audio session in a background thread
+    https://bugs.webkit.org/show_bug.cgi?id=221949
+    <rdar://problem/74315824>
+    
+    Reviewed by Eric Carlson.
+    
+    Manually tested.
+    
+    * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
+    (WebCore::AVAudioSessionCaptureDeviceManager::disableAllDevicesQuery):
+    Hop to a background thread before disabling the audio session.
+    Abort if audio session is no longer marked as unneeded.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-02-16  Youenn Fablet  <you...@apple.com>
+
+            AVAudioSessionCaptureDeviceManager should disable its audio session in a background thread
+            https://bugs.webkit.org/show_bug.cgi?id=221949
+            <rdar://problem/74315824>
+
+            Reviewed by Eric Carlson.
+
+            Manually tested.
+
+            * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
+            (WebCore::AVAudioSessionCaptureDeviceManager::disableAllDevicesQuery):
+            Hop to a background thread before disabling the audio session.
+            Abort if audio session is no longer marked as unneeded.
+
+2021-02-19  Alan Coon  <alanc...@apple.com>
+
         Cherry-pick r272379. rdar://problem/74500599
 
     Supplementary code points (U+10000 - U+10FFFF) are not shaped correctly in the fast text codepath

Modified: branches/safari-611-branch/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm (273171 => 273172)


--- branches/safari-611-branch/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm	2021-02-19 23:37:42 UTC (rev 273171)
+++ branches/safari-611-branch/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm	2021-02-19 23:37:46 UTC (rev 273172)
@@ -254,10 +254,14 @@
         return;
 
     if (m_audioSessionState == AudioSessionState::Active) {
-        NSError *error = nil;
-        [m_audioSession setActive:NO withOptions:0 error:&error];
-        if (error)
-            RELEASE_LOG_ERROR(WebRTC, "Failed to disactivate audio session with error: %@.", error.localizedDescription);
+        dispatch_async(m_dispatchQueue, makeBlockPtr([this] {
+            if (m_audioSessionState != AudioSessionState::NotNeeded)
+                return;
+            NSError *error = nil;
+            [m_audioSession setActive:NO withOptions:0 error:&error];
+            if (error)
+                RELEASE_LOG_ERROR(WebRTC, "Failed to disactivate audio session with error: %@.", error.localizedDescription);
+        }).get());
     }
 
     m_audioSessionState = AudioSessionState::NotNeeded;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to