The article considers a system of two nonlinear differential equations of one-dimensional non–stationary barotropic gas flow in Lagrangian coordinates. In the case of thermodynamic equilibrium, this system has a hyperbolic type. Such a system can be considered as a pair of differential 2-forms on a 4-dimensional space. The main idea of the article is to construct a special 5- dimensional space endowed with a contact structure. The original system generates two differential 2-forms on this contact space, which are invariant with respect to contact transformations. These forms are equal to zero if and only if the original system and the linear wave system with constant coefficients are contact equivalent. Under these conditions, we have constructed exact multivalued solutions of the barotropic gas flow equations.