فهرست منبع

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 سال پیش
والد
کامیت
9c90c721a0
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  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);
+        }
     }
 }