fix initializing ffmpeg to proper order
use inlining in singleton functions and small frequently used functions to make debugging more comfortable