code cleanup and fix for locating ffmpeg libraries