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]) {
|
if (![session beginWebRTCSession:&error]) {
|
||||||
[session unlockForConfiguration];
|
[session unlockForConfiguration];
|
||||||
RTCLogError(@"Failed to begin WebRTC session: %@", error.localizedDescription);
|
RTCLogError(@"Failed to begin WebRTC session: %@", error.localizedDescription);
|
||||||
|
audio_unit_.reset();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -857,6 +858,7 @@ bool AudioDeviceIOS::InitPlayOrRecord() {
|
|||||||
// audio session during or after a Media Services failure.
|
// audio session during or after a Media Services failure.
|
||||||
// See AVAudioSessionErrorCodeMediaServicesFailed for details.
|
// See AVAudioSessionErrorCodeMediaServicesFailed for details.
|
||||||
[session unlockForConfiguration];
|
[session unlockForConfiguration];
|
||||||
|
audio_unit_.reset();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
SetupAudioBuffersForActiveAudioSession();
|
SetupAudioBuffersForActiveAudioSession();
|
||||||
|
@ -861,6 +861,7 @@ bool AudioDeviceIOS::InitPlayOrRecord() {
|
|||||||
if (![session beginWebRTCSession:&error]) {
|
if (![session beginWebRTCSession:&error]) {
|
||||||
[session unlockForConfiguration];
|
[session unlockForConfiguration];
|
||||||
RTCLogError(@"Failed to begin WebRTC session: %@", error.localizedDescription);
|
RTCLogError(@"Failed to begin WebRTC session: %@", error.localizedDescription);
|
||||||
|
audio_unit_.reset();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -872,6 +873,7 @@ bool AudioDeviceIOS::InitPlayOrRecord() {
|
|||||||
// audio session during or after a Media Services failure.
|
// audio session during or after a Media Services failure.
|
||||||
// See AVAudioSessionErrorCodeMediaServicesFailed for details.
|
// See AVAudioSessionErrorCodeMediaServicesFailed for details.
|
||||||
[session unlockForConfiguration];
|
[session unlockForConfiguration];
|
||||||
|
audio_unit_.reset();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
SetupAudioBuffersForActiveAudioSession();
|
SetupAudioBuffersForActiveAudioSession();
|
||||||
|
Reference in New Issue
Block a user