|
@@ -186,20 +186,23 @@ namespace Vinno.vCloud.FIS.CrossPlatform.Windows.LiveVideo
|
|
|
{
|
|
|
lock (_lock)
|
|
|
{
|
|
|
- _isCapturing = false;
|
|
|
- if (_directShowCapture != null)
|
|
|
- {
|
|
|
- _directShowCapture.ImageFrameReceived -= OnImageFrameReceived;
|
|
|
- _directShowCapture.StopCapture();
|
|
|
- _directShowCapture.Dispose();
|
|
|
- _directShowCapture = null;
|
|
|
- }
|
|
|
- if (_aForgeCapturer != null)
|
|
|
+ if (_isCapturing)
|
|
|
{
|
|
|
- _aForgeCapturer.ImageFrameReceived -= OnImageFrameReceived;
|
|
|
- _aForgeCapturer.StopCapture();
|
|
|
- _aForgeCapturer.Dispose();
|
|
|
- _aForgeCapturer = null;
|
|
|
+ _isCapturing = false;
|
|
|
+ if (_directShowCapture != null)
|
|
|
+ {
|
|
|
+ _directShowCapture.ImageFrameReceived -= OnImageFrameReceived;
|
|
|
+ _directShowCapture.StopCapture();
|
|
|
+ _directShowCapture.Dispose();
|
|
|
+ _directShowCapture = null;
|
|
|
+ }
|
|
|
+ if (_aForgeCapturer != null)
|
|
|
+ {
|
|
|
+ _aForgeCapturer.ImageFrameReceived -= OnImageFrameReceived;
|
|
|
+ _aForgeCapturer.StopCapture();
|
|
|
+ _aForgeCapturer.Dispose();
|
|
|
+ _aForgeCapturer = null;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|