The number of zeros in the upper half-plane, counting multiplicities, of a matrix-valued continuous analogue of an orthogonal polynomial is shown to equal the number of negative eigenvalues of the associated integral operator with a matrix-valued kernel. This result generalizes a theorem of Krein and Langer on scalar-valued orthogonal functions to a noncommutative case. The proof relies on properties of orthogonal operator polynomials, Toeplitz operators, and Wiener-Hopf equations.