Release audio unit when ios audio device failed to initialize playout and recording.
TBR=henrika@webrtc.org Bug: webrtc:9552 Change-Id: I7c3e0c1c2126603e7b1cc412cb37cac57eb3cdbf Reviewed-on: https://webrtc-review.googlesource.com/90085 Commit-Queue: Magnus Jedvert <magjed@webrtc.org> Reviewed-by: Magnus Jedvert <magjed@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24209}
This commit is contained in:
@ -846,6 +846,7 @@ bool AudioDeviceIOS::InitPlayOrRecord() {
|
||||
if (![session beginWebRTCSession:&error]) {
|
||||
[session unlockForConfiguration];
|
||||
RTCLogError(@"Failed to begin WebRTC session: %@", error.localizedDescription);
|
||||
audio_unit_.reset();
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -857,6 +858,7 @@ bool AudioDeviceIOS::InitPlayOrRecord() {
|
||||
// audio session during or after a Media Services failure.
|
||||
// See AVAudioSessionErrorCodeMediaServicesFailed for details.
|
||||
[session unlockForConfiguration];
|
||||
audio_unit_.reset();
|
||||
return false;
|
||||
}
|
||||
SetupAudioBuffersForActiveAudioSession();
|
||||
|
@ -861,6 +861,7 @@ bool AudioDeviceIOS::InitPlayOrRecord() {
|
||||
if (![session beginWebRTCSession:&error]) {
|
||||
[session unlockForConfiguration];
|
||||
RTCLogError(@"Failed to begin WebRTC session: %@", error.localizedDescription);
|
||||
audio_unit_.reset();
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -872,6 +873,7 @@ bool AudioDeviceIOS::InitPlayOrRecord() {
|
||||
// audio session during or after a Media Services failure.
|
||||
// See AVAudioSessionErrorCodeMediaServicesFailed for details.
|
||||
[session unlockForConfiguration];
|
||||
audio_unit_.reset();
|
||||
return false;
|
||||
}
|
||||
SetupAudioBuffersForActiveAudioSession();
|
||||
|
Reference in New Issue
Block a user