0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 04:42:18 +02:00

mac-avcapture: Add pointer check for outputting NULL video frames

When a capture card or video capture source is contained in the scene
collection's list of sources, but the source is not a part of any
scene, it will be first created but then destroyed again in a deferred
fashion (as it has no strong references to it anymore).

This will happen before the capture source has finished its own
initialization, hence why the source pointer can be invalid at that
point.
This commit is contained in:
PatTheMav 2024-04-13 17:26:09 +02:00 committed by Lain
parent 8b6924b80f
commit 9c90c721a0

View File

@ -359,8 +359,10 @@
self.captureInfo->previousSurface = NULL;
}
} else {
if (self.captureInfo->source) {
obs_source_output_video(self.captureInfo->source, NULL);
}
}
}
- (BOOL)configureSessionWithPreset:(AVCaptureSessionPreset)preset withError:(NSError *__autoreleasing *)error