Internal waves in a horizontally inhomogeneous flow