ndisrc: Assume input with more than 8 raw audio channels is unpositioned

gst_audio_channel_positions_from_mask() will otherwise print warnings
all the time.

Fixes #444

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1357>
This commit is contained in:
Lieven Paulissen 2023-10-11 10:12:19 +02:00 committed by Sebastian Dröge
parent 022afa6375
commit 05aa9fa431

View file

@ -1662,10 +1662,12 @@ impl Receiver {
if [NDIlib_FourCC_audio_type_FLTp].contains(&fourcc) { if [NDIlib_FourCC_audio_type_FLTp].contains(&fourcc) {
let channels = audio_frame.no_channels() as u32; let channels = audio_frame.no_channels() as u32;
let mut positions = [gst_audio::AudioChannelPosition::None; 64]; let mut positions = [gst_audio::AudioChannelPosition::None; 64];
let _ = gst_audio::AudioChannelPosition::positions_from_mask( if channels <= 8 {
gst_audio::AudioChannelPosition::fallback_mask(channels), let _ = gst_audio::AudioChannelPosition::positions_from_mask(
&mut positions[..channels as usize], gst_audio::AudioChannelPosition::fallback_mask(channels),
); &mut positions[..channels as usize],
);
}
let builder = gst_audio::AudioInfo::builder( let builder = gst_audio::AudioInfo::builder(
gst_audio::AUDIO_FORMAT_F32, gst_audio::AUDIO_FORMAT_F32,