mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-25 21:11:00 +00:00
ndisrc: Use actual number of channels in positions_from_mask
Otherwise it fails for mono and stereo Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/991>
This commit is contained in:
parent
73ce616bd9
commit
5bbe0eab25
1 changed files with 2 additions and 2 deletions
|
@ -1591,7 +1591,7 @@ impl Receiver {
|
||||||
let mut positions = [gst_audio::AudioChannelPosition::None; 64];
|
let mut positions = [gst_audio::AudioChannelPosition::None; 64];
|
||||||
let _ = gst_audio::AudioChannelPosition::positions_from_mask(
|
let _ = gst_audio::AudioChannelPosition::positions_from_mask(
|
||||||
gst_audio::AudioChannelPosition::fallback_mask(channels),
|
gst_audio::AudioChannelPosition::fallback_mask(channels),
|
||||||
&mut positions,
|
&mut positions[..channels as usize],
|
||||||
);
|
);
|
||||||
|
|
||||||
let builder = gst_audio::AudioInfo::builder(
|
let builder = gst_audio::AudioInfo::builder(
|
||||||
|
@ -1599,7 +1599,7 @@ impl Receiver {
|
||||||
audio_frame.sample_rate() as u32,
|
audio_frame.sample_rate() as u32,
|
||||||
channels,
|
channels,
|
||||||
)
|
)
|
||||||
.positions(&positions[..audio_frame.no_channels() as usize]);
|
.positions(&positions[..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