[DllImport(Libraries.MediaTool, EntryPoint = "media_format_channel_positions_from_mask")]
internal static extern int GetChannelPositionFromMask(IntPtr handle, ulong mask,
- out MediaFormatAudioChannelPosition[] position);
+ ref MediaFormatAudioChannelPosition[] position);
[DllImport(Libraries.MediaTool, EntryPoint = "media_format_channel_positions_to_mask")]
internal static extern int GetMaskFromChannelPosition(IntPtr handle,
Bit = bit;
BitRate = bitRate;
AacType = IsAacSupportedMimeType(mimeType) ? GetAacType(handle) : MediaFormatAacType.None;
- AudioChannelMap = GetAudioChannelMap(handle);
+ AudioChannelMap = Channel == 0 ? null : GetAudioChannelMap(handle);
}
private static ReadOnlyCollection<MediaFormatAudioChannelPosition> GetAudioChannelMap(IntPtr handle)
var ret = Native.GetAudioChannelMask(handle, out ulong mask);
MultimediaDebug.AssertNoError(ret);
- ret = Native.GetChannelPositionFromMask(handle, mask, out MediaFormatAudioChannelPosition[] positions);
+ var positions = new MediaFormatAudioChannelPosition[Enum.GetNames(typeof(MediaFormatAudioChannelPosition)).Length];
+
+ ret = Native.GetChannelPositionFromMask(handle, mask, ref positions);
MultimediaDebug.AssertNoError(ret);
return positions == null ? null :