Improve codec selection