diff options
-rw-r--r-- | net/ndi/src/ndisrc/receiver.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/ndi/src/ndisrc/receiver.rs b/net/ndi/src/ndisrc/receiver.rs index 527f55d8..2fb94e2f 100644 --- a/net/ndi/src/ndisrc/receiver.rs +++ b/net/ndi/src/ndisrc/receiver.rs @@ -1662,10 +1662,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, |