diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-02-21 16:32:42 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-02-21 16:32:42 +0100 |
commit | 4505bc9cc6bb1f9206f922a992a9be0e17703df1 (patch) | |
tree | 7a98f5c2990b19683dccbfb9128ba1cd5c9bacd9 /src/modules/module-jack-sink.c | |
parent | 27bfa607b90b25aa4fdefc0882091093164297a5 (diff) |
introduce default channel map in addition to the default sample spec
Diffstat (limited to 'src/modules/module-jack-sink.c')
-rw-r--r-- | src/modules/module-jack-sink.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/modules/module-jack-sink.c b/src/modules/module-jack-sink.c index b448e84e2..1739f46a8 100644 --- a/src/modules/module-jack-sink.c +++ b/src/modules/module-jack-sink.c @@ -329,12 +329,18 @@ int pa__init(pa_module*m) { if (!channels) channels = m->core->default_sample_spec.channels; - if (pa_modargs_get_value_u32(ma, "channels", &channels) < 0 || channels <= 0 || channels >= PA_CHANNELS_MAX) { + if (pa_modargs_get_value_u32(ma, "channels", &channels) < 0 || + channels <= 0 || + channels > PA_CHANNELS_MAX) { pa_log("Failed to parse channels= argument."); goto fail; } - pa_channel_map_init_extend(&map, channels, PA_CHANNEL_MAP_ALSA); + if (channels == m->core->default_channel_map.channels) + map = m->core->default_channel_map; + else + pa_channel_map_init_extend(&map, channels, PA_CHANNEL_MAP_ALSA); + if (pa_modargs_get_channel_map(ma, NULL, &map) < 0 || map.channels != channels) { pa_log("Failed to parse channel_map= argument."); goto fail; |