Lines Matching refs:cm
151 int pa_sndfile_read_channel_map(SNDFILE *sf, pa_channel_map *cm) { in pa_sndfile_read_channel_map() argument
184 pa_assert(cm); in pa_sndfile_read_channel_map()
198 cm->channels = (uint8_t) sfi.channels; in pa_sndfile_read_channel_map()
199 for (c = 0; c < cm->channels; c++) { in pa_sndfile_read_channel_map()
206 cm->map[c] = table[channels[c]]; in pa_sndfile_read_channel_map()
211 if (!pa_channel_map_valid(cm)) in pa_sndfile_read_channel_map()
217 int pa_sndfile_write_channel_map(SNDFILE *sf, pa_channel_map *cm) { in pa_sndfile_write_channel_map() argument
285 pa_assert(cm); in pa_sndfile_write_channel_map()
288 if (cm->channels == 1 && cm->map[0] == PA_CHANNEL_POSITION_MONO) in pa_sndfile_write_channel_map()
291 if (cm->channels == 2 && in pa_sndfile_write_channel_map()
292 cm->map[0] == PA_CHANNEL_POSITION_FRONT_LEFT && in pa_sndfile_write_channel_map()
293 cm->map[1] == PA_CHANNEL_POSITION_FRONT_RIGHT) in pa_sndfile_write_channel_map()
296 channels = pa_xnew(int, cm->channels); in pa_sndfile_write_channel_map()
297 for (c = 0; c < cm->channels; c++) { in pa_sndfile_write_channel_map()
299 if (cm->map[c] < 0 || in pa_sndfile_write_channel_map()
300 cm->map[c] >= PA_CHANNEL_POSITION_MAX || in pa_sndfile_write_channel_map()
301 table[cm->map[c]] < 0) { in pa_sndfile_write_channel_map()
306 channels[c] = table[cm->map[c]]; in pa_sndfile_write_channel_map()
309 if (!sf_command(sf, SFC_SET_CHANNEL_MAP_INFO, channels, sizeof(channels[0]) * cm->channels)) { in pa_sndfile_write_channel_map()