mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
introduce default channel map in addition to the default sample spec
This commit is contained in:
parent
27bfa607b9
commit
4505bc9cc6
24 changed files with 180 additions and 147 deletions
|
|
@ -296,12 +296,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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue