thread mess check for avcodec_open/close()