Skip to content

Commit

Permalink
Merge pull request #11 from m0rk/master
Browse files Browse the repository at this point in the history
only add input to the session if there is an input
  • Loading branch information
pietbrauer committed Jan 22, 2015
2 parents e461cd9 + 2262a42 commit 124f3b0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Classes/NBNImageCaptureCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ - (void)setupImagePicker {
AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
NSError *error = nil;
AVCaptureDeviceInput *input = [AVCaptureDeviceInput deviceInputWithDevice:device error:&error];
[captureSession addInput:input];

if (input) {
[captureSession addInput:input];
}

AVCaptureVideoPreviewLayer *captureVideoPreviewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:captureSession];
captureVideoPreviewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
Expand Down

0 comments on commit 124f3b0

Please sign in to comment.