fixed unhandled exception for capture

VideoCapture was attemping to read video input before checking if the
video input was opened. This also caused a problem with stopping the
timer later on when the dialog was closed.