add GNU/Linux support
fix MSVC errors
fix vid_restart segfault
fix few compiler warnings