summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/alsa-util.c22
-rw-r--r--src/modules/module-jack-sink.c3
-rw-r--r--src/modules/module-jack-source.c3
-rw-r--r--src/modules/module-zeroconf-discover.c9
-rw-r--r--src/pulsecore/core-scache.c3
-rw-r--r--src/pulsecore/sound-file.c5
6 files changed, 9 insertions, 36 deletions
diff --git a/src/modules/alsa-util.c b/src/modules/alsa-util.c
index 1fef6d63..5d52cbc9 100644
--- a/src/modules/alsa-util.c
+++ b/src/modules/alsa-util.c
@@ -668,26 +668,8 @@ snd_pcm_t *pa_alsa_open_by_device_string(
*dev = d;
- if (ss->channels != map->channels) {
- if (!pa_channel_map_init_auto(map, ss->channels, PA_CHANNEL_MAP_ALSA)) {
- unsigned c;
- pa_channel_position_t pos;
-
- pa_log_warn("Device has an unknown channel mapping. This is a limitation of ALSA. Synthesizing channel map.");
-
- for (c = ss->channels; c > 0; c--)
- if (pa_channel_map_init_auto(map, c, PA_CHANNEL_MAP_ALSA))
- break;
-
- pa_assert(c > 0);
-
- pos = PA_CHANNEL_POSITION_AUX0;
- for (; c < map->channels; c ++)
- map->map[c] = pos++;
-
- map->channels = ss->channels;
- }
- }
+ if (ss->channels != map->channels)
+ pa_channel_map_init_extend(map, ss->channels, PA_CHANNEL_MAP_ALSA);
return pcm_handle;
}
diff --git a/src/modules/module-jack-sink.c b/src/modules/module-jack-sink.c
index 61ad79c2..c4d47f8e 100644
--- a/src/modules/module-jack-sink.c
+++ b/src/modules/module-jack-sink.c
@@ -330,8 +330,7 @@ int pa__init(pa_module*m) {
goto fail;
}
- pa_assert_se(pa_channel_map_init_auto(&map, channels, PA_CHANNEL_MAP_AUX));
- pa_channel_map_init_auto(&map, channels, PA_CHANNEL_MAP_ALSA);
+ 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;
diff --git a/src/modules/module-jack-source.c b/src/modules/module-jack-source.c
index 880bb603..03f9d15c 100644
--- a/src/modules/module-jack-source.c
+++ b/src/modules/module-jack-source.c
@@ -301,8 +301,7 @@ int pa__init(pa_module*m) {
goto fail;
}
- pa_assert_se(pa_channel_map_init_auto(&map, channels, PA_CHANNEL_MAP_AUX));
- pa_channel_map_init_auto(&map, channels, PA_CHANNEL_MAP_ALSA);
+ 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;
diff --git a/src/modules/module-zeroconf-discover.c b/src/modules/module-zeroconf-discover.c
index c4057739..2fc81370 100644
--- a/src/modules/module-zeroconf-discover.c
+++ b/src/modules/module-zeroconf-discover.c
@@ -162,8 +162,7 @@ static void resolver_cb(
pa_module *m;
ss = u->core->default_sample_spec;
- pa_assert_se(pa_channel_map_init_auto(&cm, ss.channels, PA_CHANNEL_MAP_AUX));
- pa_channel_map_init_auto(&cm, ss.channels, PA_CHANNEL_MAP_DEFAULT);
+ pa_channel_map_init_extend(&cm, ss.channels, PA_CHANNEL_MAP_DEFAULT);
for (l = txt; l; l = l->next) {
char *key, *value;
@@ -188,10 +187,8 @@ static void resolver_cb(
avahi_free(value);
}
- if (!channel_map_set && cm.channels != ss.channels) {
- pa_assert_se(pa_channel_map_init_auto(&cm, ss.channels, PA_CHANNEL_MAP_AUX));
- pa_channel_map_init_auto(&cm, ss.channels, PA_CHANNEL_MAP_DEFAULT);
- }
+ if (!channel_map_set && cm.channels != ss.channels)
+ pa_channel_map_init_extend(&cm, ss.channels, PA_CHANNEL_MAP_DEFAULT);
if (!pa_sample_spec_valid(&ss)) {
pa_log("Service '%s' contains an invalid sample specification.", name);
diff --git a/src/pulsecore/core-scache.c b/src/pulsecore/core-scache.c
index ed3758f0..75fa2ff1 100644
--- a/src/pulsecore/core-scache.c
+++ b/src/pulsecore/core-scache.c
@@ -162,8 +162,7 @@ int pa_scache_add_item(
pa_assert(!map || (pa_channel_map_valid(map) && ss && ss->channels == map->channels));
if (ss && !map)
- if (!(map = pa_channel_map_init_auto(&tmap, ss->channels, PA_CHANNEL_MAP_DEFAULT)))
- return -1;
+ pa_channel_map_init_extend(&tmap, ss->channels, PA_CHANNEL_MAP_DEFAULT);
if (chunk && chunk->length > PA_SCACHE_ENTRY_SIZE_MAX)
return -1;
diff --git a/src/pulsecore/sound-file.c b/src/pulsecore/sound-file.c
index 57c17760..3183ede6 100644
--- a/src/pulsecore/sound-file.c
+++ b/src/pulsecore/sound-file.c
@@ -117,10 +117,7 @@ int pa_sound_file_load(
}
if (map)
- if (!pa_channel_map_init_auto(map, ss->channels, PA_CHANNEL_MAP_DEFAULT)) {
- pa_log("Unsupported channel map in file %s", fname);
- goto finish;
- }
+ pa_channel_map_init_extend(map, ss->channels, PA_CHANNEL_MAP_DEFAULT);
if ((l = pa_frame_size(ss) * sfinfo.frames) > PA_SCACHE_ENTRY_SIZE_MAX) {
pa_log("File too large");