feat(ios): Handle audio interruption in session queue. This prevents the session isRunning flag from getting corrupted due to concurrent updates to the session. (#2567)

This commit is contained in:
cristianoccazinsp 2019-11-11 11:42:58 -03:00 committed by Sibelius Seraphini
parent be8a08ce9c
commit ffbd805bcf

View File

@ -82,7 +82,6 @@ BOOL _sessionInterrupted = NO;
_recordRequested = NO;
_sessionInterrupted = NO;
// we will do other initialization after
// the view is loaded.
// This is to prevent code if the view is unused as react
@ -1488,7 +1487,10 @@ BOOL _sessionInterrupted = NO;
// if we have audio, stop it so preview resumes
// it will eventually be re-loaded the next time recording
// is requested, although it will flicker.
[self removeAudioCaptureSessionInput];
dispatch_async(self.sessionQueue, ^{
[self removeAudioCaptureSessionInput];
});
}
}