aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common
diff options
context:
space:
mode:
authorShai Frieder <Shai.Frieder@twine-s.com>2019-04-08 09:42:10 +0300
committerShai Frieder <Shai.Frieder@twine-s.com>2019-04-08 09:42:10 +0300
commit49db61f198119289433e1f2e35b97e011c47aefe (patch)
treec04d78e2abb5aac8c22350c90cb8b469f6eca30d /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common
parentc9fc2b64bdb42f11976a020a856dde10d469c0e6 (diff)
parent1608e69a417bc5e40a607c3958c4a60f19f66f1a (diff)
downloadTango-49db61f198119289433e1f2e35b97e011c47aefe.tar.gz
Tango-49db61f198119289433e1f2e35b97e011c47aefe.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Video/DefaultVideoCaptureProvider.cs17
1 files changed, 9 insertions, 8 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Video/DefaultVideoCaptureProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Video/DefaultVideoCaptureProvider.cs
index 3aa9d4c88..f710cf082 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Video/DefaultVideoCaptureProvider.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Video/DefaultVideoCaptureProvider.cs
@@ -28,16 +28,17 @@ namespace Tango.MachineStudio.Common.Video
var availableDevices = CaptureDevice.GetAvailableCaptureDevices();
- for (int i = 0; i < 3; i++)
+ for (int i = 0; i < availableDevices.Count; i++)
{
- if (i > availableDevices.Count - 1)
- {
- AvailableCaptureDevices.Add(new CaptureDevice() { Device = null });
- }
- else
+ AvailableCaptureDevices.Add(new CaptureDevice() { Device = availableDevices[i] });
+ }
+
+ while (AvailableCaptureDevices.Count < 3)
+ {
+ AvailableCaptureDevices.Add(new CaptureDevice()
{
- AvailableCaptureDevices.Add(new CaptureDevice() { Device = availableDevices[i] });
- }
+ Device = null,
+ });
}
}
}