fix libav build

okay this should fix the libav build. There are still alot of issues that need we need tests for, but it builds!