mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-25 21:11:00 +00:00
ndisrc: Use default channel mask for audio output
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/988>
This commit is contained in:
parent
72f616fa14
commit
73ce616bd9
1 changed files with 10 additions and 2 deletions
|
@ -1587,11 +1587,19 @@ impl Receiver {
|
|||
let fourcc = audio_frame.fourcc();
|
||||
|
||||
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,
|
||||
);
|
||||
|
||||
let builder = gst_audio::AudioInfo::builder(
|
||||
gst_audio::AUDIO_FORMAT_F32,
|
||||
audio_frame.sample_rate() as u32,
|
||||
audio_frame.no_channels() as u32,
|
||||
);
|
||||
channels,
|
||||
)
|
||||
.positions(&positions[..audio_frame.no_channels() as usize]);
|
||||
|
||||
let info = builder.build().map_err(|_| {
|
||||
gst::element_error!(
|
||||
|
|
Loading…
Reference in a new issue