Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(468)

Unified Diff: sdk/objc/Framework/Classes/VideoToolbox/RTCVideoDecoderH264.mm

Issue 3016703002: Fix occassional hang in iOS 11 when calling VTDecompressionSessionInvalidate.
Patch Set: Merge branch 'master' of https://chromium.googlesource.com/external/webrtc into hang Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/objc/Framework/Classes/VideoToolbox/RTCVideoDecoderH264.mm
diff --git a/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoDecoderH264.mm b/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoDecoderH264.mm
index 6e000ab747eb3777dc866bbeeee4edbab9902a92..6b608ced8cc4f72d64f0eda9950138daba0f2447 100644
--- a/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoDecoderH264.mm
+++ b/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoDecoderH264.mm
@@ -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,7 +237,15 @@ void decompressionOutputCallback(void *decoder,
- (void)destroyDecompressionSession {
if (_decompressionSession) {
- VTDecompressionSessionInvalidate(_decompressionSession);
+#if defined(WEBRTC_IOS)
+ if ([UIDevice isIOS11OrLater]) {
+ VTDecompressionSessionWaitForAsynchronousFrames(_decompressionSession);
+ } else {
+#endif
+ VTDecompressionSessionInvalidate(_decompressionSession);
+#if defined(WEBRTC_IOS)
+ }
+#endif
CFRelease(_decompressionSession);
_decompressionSession = nullptr;
}
« no previous file with comments | « sdk/objc/Framework/Classes/Common/UIDevice+RTCDevice.mm ('k') | sdk/objc/Framework/Headers/WebRTC/UIDevice+RTCDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698