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/1387>
This commit is contained in:
Lieven Paulissen 2023-10-11 10:12:19 +02:00 committed by Sebastian Dröge
parent ac3ca76c9f
commit beb524e950

View file

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