James Smith swung a punch at a police officer, hitting him in the mouth and causing a cut to his lip, the court heard