aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Audio/Backends/Common/HardwareDeviceSessionOutputBase.cs
diff options
context:
space:
mode:
authorMary <me@thog.eu>2021-05-05 23:37:09 +0200
committerGitHub <noreply@github.com>2021-05-05 23:37:09 +0200
commiteb056218a13fa145adcc9ecafd166b1b1f2caccb (patch)
treecbc911c3473fd431e70f1dfb1e143f1acd2f6178 /Ryujinx.Audio/Backends/Common/HardwareDeviceSessionOutputBase.cs
parent106512229e36a570e945e1b60963ff3bd56937c4 (diff)
audio: Implement a SDL2 backend (#2258)
* audio: Implement a SDL2 backend This adds support to SDL2 as an audio backend. It has the same compatibility level as OpenAL without its issues. I also took the liberty of restructuring the SDL2 code to have one shared project between audio and input. The configuration version was also incremented. * Address gdkchan's comments * Fix update logic * Add an heuristic to pick the correct target sample count wanted by the game * Address gdkchan's comments * Address Ac_k's comments * Fix audren output * Address gdkchan's comments
Diffstat (limited to 'Ryujinx.Audio/Backends/Common/HardwareDeviceSessionOutputBase.cs')
-rw-r--r--Ryujinx.Audio/Backends/Common/HardwareDeviceSessionOutputBase.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/Ryujinx.Audio/Backends/Common/HardwareDeviceSessionOutputBase.cs b/Ryujinx.Audio/Backends/Common/HardwareDeviceSessionOutputBase.cs
index 1e000e4c..f1f0039c 100644
--- a/Ryujinx.Audio/Backends/Common/HardwareDeviceSessionOutputBase.cs
+++ b/Ryujinx.Audio/Backends/Common/HardwareDeviceSessionOutputBase.cs
@@ -18,6 +18,7 @@
using Ryujinx.Audio.Common;
using Ryujinx.Audio.Integration;
using Ryujinx.Memory;
+using System.Runtime.CompilerServices;
namespace Ryujinx.Audio.Backends.Common
{
@@ -52,7 +53,13 @@ namespace Ryujinx.Audio.Backends.Common
protected ulong GetSampleCount(AudioBuffer buffer)
{
- return (ulong)BackendHelper.GetSampleCount(RequestedSampleFormat, (int)RequestedChannelCount, (int)buffer.DataSize);
+ return GetSampleCount((int)buffer.DataSize);
+ }
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ protected ulong GetSampleCount(int dataSize)
+ {
+ return (ulong)BackendHelper.GetSampleCount(RequestedSampleFormat, (int)RequestedChannelCount, dataSize);
}
public abstract void Dispose();