summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlapinskijw <jlapinski.dev@gmail.com>2020-05-12 16:12:47 -0400
committerlapinskijw <jlapinski.dev@gmail.com>2020-05-12 16:12:47 -0400
commit3c9c2075e91c95df85cfad210e8825c23731bf4a (patch)
treef7a3c8bfaa54dce7762283dc051feee3cab446b8
parent88f083e98e5de93541f94bdf3cfe3e1923b6178a (diff)
downloadsdl_ios-3c9c2075e91c95df85cfad210e8825c23731bf4a.tar.gz
added check for invalid session
-rw-r--r--SmartDeviceLink/SDLH264VideoEncoder.m6
1 files changed, 5 insertions, 1 deletions
diff --git a/SmartDeviceLink/SDLH264VideoEncoder.m b/SmartDeviceLink/SDLH264VideoEncoder.m
index aaa868f42..4f4f11a77 100644
--- a/SmartDeviceLink/SDLH264VideoEncoder.m
+++ b/SmartDeviceLink/SDLH264VideoEncoder.m
@@ -158,7 +158,11 @@ static NSDictionary<NSString *, id>* _defaultVideoEncoderSettings;
self.currentFrameNumber++;
OSStatus status = VTCompressionSessionEncodeFrame(_compressionSession, imageBuffer, presentationTimestamp, kCMTimeInvalid, NULL, (__bridge void *)self, NULL);
- VTCompressionSessionCompleteFrames(_compressionSession, presentationTimestamp);
+
+ if (status == kVTInvalidSessionErr) {
+ VTCompressionSessionCompleteFrames(_compressionSession, presentationTimestamp);
+ [self sdl_resetCompressionSession];
+ }
return (status == noErr);
}