Check codec kinds for each direction properly when mapping to profiles corresponding to it. Being sloppy here masked another bug, so best fix it.