Fix occassional hang in iOS 11 when calling VTDecompressionSessionInvalidate.
BUG=webrtc:8302 Change-Id: I426116c621c53a0300f87a2a5dc147578b559ed6 Reviewed-on: https://webrtc-review.googlesource.com/4520 Reviewed-by: Zeke Chin <tkchin@webrtc.org> Reviewed-by: Kári Helgason <kthelgason@webrtc.org> Commit-Queue: JT Teh <jtteh@webrtc.org> Cr-Commit-Position: refs/heads/master@{#20026}
This commit is contained in:
@ -173,4 +173,8 @@
|
||||
return [self currentDeviceSystemVersion] >= 9.0;
|
||||
}
|
||||
|
||||
+ (BOOL)isIOS11OrLater {
|
||||
return [self currentDeviceSystemVersion] >= 11.0;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
|
||||
#if defined(WEBRTC_IOS)
|
||||
#import "Common/RTCUIApplicationStatusObserver.h"
|
||||
#import "WebRTC/UIDevice+RTCDevice.h"
|
||||
#endif
|
||||
|
||||
// Struct that we pass to the decoder per frame to decode. We receive it again
|
||||
@ -236,6 +237,11 @@ void decompressionOutputCallback(void *decoder,
|
||||
|
||||
- (void)destroyDecompressionSession {
|
||||
if (_decompressionSession) {
|
||||
#if defined(WEBRTC_IOS)
|
||||
if ([UIDevice isIOS11OrLater]) {
|
||||
VTDecompressionSessionWaitForAsynchronousFrames(_decompressionSession);
|
||||
}
|
||||
#endif
|
||||
VTDecompressionSessionInvalidate(_decompressionSession);
|
||||
CFRelease(_decompressionSession);
|
||||
_decompressionSession = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user