Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLieven Paulissen <lieven.paulissen@theoplayer.com>2023-10-11 11:12:19 +0300
committerSebastian Dröge <sebastian@centricular.com>2023-11-10 18:47:41 +0300
commitbeb524e95038be2d0cd20be2458c96058f576ef7 (patch)
tree63de7846a5d4f2b0e66146f2af41717dc5fa7774
parentac3ca76c9f7d0bd15344859da98217a055d6dff3 (diff)
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>
-rw-r--r--net/ndi/src/ndisrc/receiver.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/ndi/src/ndisrc/receiver.rs b/net/ndi/src/ndisrc/receiver.rs
index 1a85a3eff..7a616a0c9 100644
--- a/net/ndi/src/ndisrc/receiver.rs
+++ b/net/ndi/src/ndisrc/receiver.rs
@@ -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,