AVIPlayer validates file before creating video.

some code cleanup