call avformat_alloc_context and make sure not to free it if ffmpeg
frees it.