Use correct ALSA channels

This commit is contained in:
Pierre Krieger 2015-09-27 13:27:00 +02:00
parent f795936b03
commit 55dbfa881e
1 changed files with 4 additions and 1 deletions

View File

@ -138,7 +138,10 @@ impl Endpoint {
let max_channels = cmp::min(max_channels, 32); // TODO: limiting to 32 channels or too much stuff is returned
let supported_channels = (min_channels .. max_channels + 1).filter_map(|num| {
if alsa::snd_pcm_hw_params_test_channels(playback_handle, hw_params.0, num) == 0 {
Some(iter::repeat(ChannelPosition::FrontLeft).take(num as usize).collect::<Vec<_>>()) // FIXME:
Some([ChannelPosition::FrontLeft, ChannelPosition::FrontRight,
ChannelPosition::BackLeft, ChannelPosition::BackRight,
ChannelPosition::FrontCenter, ChannelPosition::LowFrequency]
.iter().take(num as usize).cloned().collect::<Vec<_>>())
} else {
None
}