documented that av_codec_close is required to call