PA_CHANNEL_MAP_DEFAULT is nearly useless
@tanuk
Submitted by Tanu Kaskinen Assigned to pul..@..op.org
Description
The usefulness of the whole pa_channel_map_def enum is questionable. It's only used with pa_channel_map_init_auto(), and that function is prone to cause bugs, because client programmers like to use it instead of initializing the channel map properly. pa_channel_map_init_auto() is very rarely the right choice. But this bug is not about that. This bug is about the PA_CHANNEL_MAP_DEFAULT definition. The only use that I can think for that definition is when only the number of channels is known, and pulseaudio should guess what the channel map is. Currently it's defined as PA_CHANNEL_MAP_AIFF, which is not very suitable for being the default: it only contains definitions for up to 6 channels, and even the 6-channel definition is not a 5.1 mapping (no lfe channel). The default mapping should be our best guess for what is the most common channel map for a given number of channels.
Also, pa_channel_map_def (or pa_channel_map_init_auto()) should be documented better. The documentation should clearly say when it's appropriate to auto-init the channel map and when it should be initialized manually.