mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-01-26 10:58:11 +00:00
ndisrc: Use default channel mask for audio output
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/989>
This commit is contained in:
parent
6a05b7f56a
commit
cadf36ff01
1 changed files with 10 additions and 2 deletions
|
@ -1587,11 +1587,19 @@ impl Receiver {
|
||||||
let fourcc = audio_frame.fourcc();
|
let fourcc = audio_frame.fourcc();
|
||||||
|
|
||||||
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 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(
|
let builder = gst_audio::AudioInfo::builder(
|
||||||
gst_audio::AUDIO_FORMAT_F32,
|
gst_audio::AUDIO_FORMAT_F32,
|
||||||
audio_frame.sample_rate() as u32,
|
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(|_| {
|
let info = builder.build().map_err(|_| {
|
||||||
gst::element_error!(
|
gst::element_error!(
|
||||||
|
|
Loading…
Reference in a new issue