Pārlūkot izejas kodu

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.
PatTheMav 1 gadu atpakaļ
vecāks
revīzija
9c90c721a0
1 mainītis faili ar 3 papildinājumiem un 1 dzēšanām
  1. 3 1
      plugins/mac-avcapture/OBSAVCapture.m

+ 3 - 1
plugins/mac-avcapture/OBSAVCapture.m

@@ -359,7 +359,9 @@
             self.captureInfo->previousSurface = NULL;
         }
     } else {
-        obs_source_output_video(self.captureInfo->source, NULL);
+        if (self.captureInfo->source) {
+            obs_source_output_video(self.captureInfo->source, NULL);
+        }
     }
 }