diff --git a/Chapter2_iPhoneAR/Example_MarkerBasedAR/Example_MarkerBasedAR/VideoSource.mm b/Chapter2_iPhoneAR/Example_MarkerBasedAR/Example_MarkerBasedAR/VideoSource.mm index 5459b7f..2fe6b1a 100644 --- a/Chapter2_iPhoneAR/Example_MarkerBasedAR/Example_MarkerBasedAR/VideoSource.mm +++ b/Chapter2_iPhoneAR/Example_MarkerBasedAR/Example_MarkerBasedAR/VideoSource.mm @@ -146,7 +146,7 @@ - (bool) startWithDevicePosition:(AVCaptureDevicePosition)devicePosition AVCaptureDeviceInput *videoIn = [AVCaptureDeviceInput deviceInputWithDevice:videoDevice error:&error]; self.deviceInput = videoIn; - if (!error) + if (nil != videoIn) { if ([[self captureSession] canAddInput:videoIn]) { @@ -160,7 +160,7 @@ - (bool) startWithDevicePosition:(AVCaptureDevicePosition)devicePosition } else { - NSLog(@"Couldn't create video input"); + NSLog(@"Couldn't create video input: %@", [error localizedDescription]); return FALSE; } }