Changeset 272913 in webkit


Ignore:
Timestamp:
Feb 16, 2021 10:04:41 AM (3 years ago)
Author:
youenn@apple.com
Message:

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.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r272911 r272913  
     12021-02-16  Youenn Fablet  <youenn@apple.com>
     2
     3        AVAudioSessionCaptureDeviceManager should disable its audio session in a background thread
     4        https://bugs.webkit.org/show_bug.cgi?id=221949
     5        <rdar://problem/74315824>
     6
     7        Reviewed by Eric Carlson.
     8
     9        Manually tested.
     10
     11        * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
     12        (WebCore::AVAudioSessionCaptureDeviceManager::disableAllDevicesQuery):
     13        Hop to a background thread before disabling the audio session.
     14        Abort if audio session is no longer marked as unneeded.
     15
    1162021-02-16  Youenn Fablet  <youenn@apple.com>
    217
  • trunk/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm

    r271487 r272913  
    254254
    255255    if (m_audioSessionState == AudioSessionState::Active) {
    256         NSError *error = nil;
    257         [m_audioSession setActive:NO withOptions:0 error:&error];
    258         if (error)
    259             RELEASE_LOG_ERROR(WebRTC, "Failed to disactivate audio session with error: %@.", error.localizedDescription);
     256        dispatch_async(m_dispatchQueue, makeBlockPtr([this] {
     257            if (m_audioSessionState != AudioSessionState::NotNeeded)
     258                return;
     259            NSError *error = nil;
     260            [m_audioSession setActive:NO withOptions:0 error:&error];
     261            if (error)
     262                RELEASE_LOG_ERROR(WebRTC, "Failed to disactivate audio session with error: %@.", error.localizedDescription);
     263        }).get());
    260264    }
    261265
Note: See TracChangeset for help on using the changeset viewer.