diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2017-02-23 09:21:32 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-23 09:21:32 -0500 |
commit | 77d473bc5a46ba3b00b22c243f9e6b4233809d01 (patch) | |
tree | 6468d0274ee37b321d370ab36af950d788ad299d | |
parent | 0703cf1f49c7ad8b2bee7a958fa4734376551b62 (diff) | |
parent | 6a16f7986743d34cf5e56262690390fe33a82d53 (diff) | |
download | sdl_ios-77d473bc5a46ba3b00b22c243f9e6b4233809d01.tar.gz |
Merge pull request #542 from smartdevicelink/hotfix/issue_529
Fix issue with disconnecting while streaming video.
-rw-r--r-- | SmartDeviceLink/SDLStreamingMediaManager.m | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/SmartDeviceLink/SDLStreamingMediaManager.m b/SmartDeviceLink/SDLStreamingMediaManager.m index d05daa93e..ab7cde8c5 100644 --- a/SmartDeviceLink/SDLStreamingMediaManager.m +++ b/SmartDeviceLink/SDLStreamingMediaManager.m @@ -384,13 +384,17 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark Callbacks -void sdl_videoEncoderOutputCallback(void *outputCallbackRefCon, void *sourceFrameRefCon, OSStatus status, VTEncodeInfoFlags infoFlags, CMSampleBufferRef sampleBuffer) { +void sdl_videoEncoderOutputCallback(void * CM_NULLABLE outputCallbackRefCon, void * CM_NULLABLE sourceFrameRefCon, OSStatus status, VTEncodeInfoFlags infoFlags, CM_NULLABLE CMSampleBufferRef sampleBuffer) { // If there was an error in the encoding, drop the frame if (status != noErr) { [SDLDebugTool logFormat:@"Error encoding video, err=%lld", (int64_t)status]; return; } + if (outputCallbackRefCon == NULL || sourceFrameRefCon == NULL || sampleBuffer == NULL) { + return; + } + SDLStreamingMediaManager *mediaManager = (__bridge SDLStreamingMediaManager *)sourceFrameRefCon; NSData *elementaryStreamData = [mediaManager.class sdl_encodeElementaryStreamWithSampleBuffer:sampleBuffer]; |