capture.cpp: added error checking, plus more
capture.cpp: added error checking, plus more

More error checking.
Misc spacing and other minor changes.
thomasjacquin/allsky,thomasjacquin/allsky,thomasjacquin/allsky