"channels=<number of channels> "
"rate=<sample rate> "
"fragments=<number of fragments> "
- "fragment_size=<fragment size>")
+ "fragment_size=<fragment size> "
+ "channel_map=<channel map>")
struct userdata {
pa_sink *sink;
"format",
"rate",
"channels",
+ "channel_map",
NULL
};
int playback = 1, record = 1;
pa_modargs *ma = NULL;
char hwdesc[64];
-
+ pa_channel_map map;
+
assert(c);
assert(m);
}
u->sample_spec = c->default_sample_spec;
- if (pa_modargs_get_sample_spec(ma, &u->sample_spec) < 0) {
- pa_log(__FILE__": failed to parse sample specification");
+ if (pa_modargs_get_sample_spec_and_channel_map(ma, &u->sample_spec, &map) < 0) {
+ pa_log(__FILE__": failed to parse sample specification or channel map");
goto fail;
}
}
} else {
- if (!(u->source = pa_source_new(c, __FILE__, pa_modargs_get_value(ma, "source_name", DEFAULT_SOURCE_NAME), 0, &u->sample_spec, NULL)))
+ if (!(u->source = pa_source_new(c, __FILE__, pa_modargs_get_value(ma, "source_name", DEFAULT_SOURCE_NAME), 0, &u->sample_spec, &map)))
goto fail;
u->source->userdata = u;
} else {
pa_silence_memory(u->out_mmap, u->out_mmap_length, &u->sample_spec);
- if (!(u->sink = pa_sink_new(c, __FILE__, pa_modargs_get_value(ma, "sink_name", DEFAULT_SINK_NAME), 0, &u->sample_spec, NULL)))
+ if (!(u->sink = pa_sink_new(c, __FILE__, pa_modargs_get_value(ma, "sink_name", DEFAULT_SINK_NAME), 0, &u->sample_spec, &map)))
goto fail;
u->sink->get_latency = sink_get_latency_cb;