diff options
author | lapinskijw <jlapinski.dev@gmail.com> | 2020-05-12 16:12:47 -0400 |
---|---|---|
committer | lapinskijw <jlapinski.dev@gmail.com> | 2020-05-12 16:12:47 -0400 |
commit | 3c9c2075e91c95df85cfad210e8825c23731bf4a (patch) | |
tree | f7a3c8bfaa54dce7762283dc051feee3cab446b8 | |
parent | 88f083e98e5de93541f94bdf3cfe3e1923b6178a (diff) | |
download | sdl_ios-3c9c2075e91c95df85cfad210e8825c23731bf4a.tar.gz |
added check for invalid session
-rw-r--r-- | SmartDeviceLink/SDLH264VideoEncoder.m | 6 |
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); } |