Logo Search packages:      
Sourcecode: pulseaudio version File versions

pa_channel_map* pa_channel_map_init_extend ( pa_channel_map m,
unsigned  channels,
pa_channel_map_def_t  def 
)

Similar to pa_channel_map_init_auto() but instead of failing if no default mapping is known with the specified parameters it will synthesize a mapping based on a known mapping with fewer channels and fill up the rest with AUX0...AUX31 channels

Since:
0.9.11

Definition at line 396 of file channelmap.c.

References pa_channel_map::channels, pa_channel_map::map, and PA_CHANNELS_MAX.

                                                                                                           {
    unsigned c;

    pa_assert(m);
    pa_assert(channels > 0);
    pa_assert(channels <= PA_CHANNELS_MAX);
    pa_assert(def < PA_CHANNEL_MAP_DEF_MAX);

    pa_channel_map_init(m);

    for (c = channels; c > 0; c--) {

        if (pa_channel_map_init_auto(m, c, def)) {
            unsigned i = 0;

            for (; c < channels; c++) {

                m->map[c] = PA_CHANNEL_POSITION_AUX0 + i;
                i++;
            }

            m->channels = (uint8_t) channels;

            return m;
        }
    }

    return NULL;
}


Generated by  Doxygen 1.6.0   Back to index