Fix build and avcodec initialization.