aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceDriver.cs
diff options
context:
space:
mode:
authorTSRBerry <20988865+TSRBerry@users.noreply.github.com>2023-06-25 22:50:59 +0200
committerGitHub <noreply@github.com>2023-06-25 22:50:59 +0200
commit42d31f646dfe2dfc8ed646102c06ca44af7b8b07 (patch)
tree0e7b0a10c2b0e6cb06ea57e9e69d8b5cab2cd329 /src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceDriver.cs
parent07fc3ded687fd1321f9ae73d0c72b2d7566c87d5 (diff)
[Ryujinx.Audio.Backends.SDL2] Address dotnet-format issues (#5364)1.1.918
* dotnet format style --severity info Some changes were manually reverted. * dotnet format analyzers --serverity info Some changes have been minimally adapted. * Address dotnet format CA1816 warnings * Address most dotnet format whitespace warnings * Run dotnet format style after rebase * Run dotnet format analyzers after rebase * Simplify properties and array initialization, Use const when possible, Remove trailing commas * Revert "Simplify properties and array initialization, Use const when possible, Remove trailing commas" This reverts commit 9462e4136c0a2100dc28b20cf9542e06790aa67e. * dotnet format whitespace after rebase * Update src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceDriver.cs Co-authored-by: Ac_K <Acoustik666@gmail.com> --------- Co-authored-by: Ac_K <Acoustik666@gmail.com>
Diffstat (limited to 'src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceDriver.cs')
-rw-r--r--src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceDriver.cs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceDriver.cs b/src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceDriver.cs
index 7bfff5f9..550cc349 100644
--- a/src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceDriver.cs
+++ b/src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceDriver.cs
@@ -19,12 +19,14 @@ namespace Ryujinx.Audio.Backends.SDL2
private readonly ManualResetEvent _pauseEvent;
private readonly ConcurrentDictionary<SDL2HardwareDeviceSession, byte> _sessions;
- private bool _supportSurroundConfiguration;
+ private readonly bool _supportSurroundConfiguration;
// TODO: Add this to SDL2-CS
// NOTE: We use a DllImport here because of marshaling issue for spec.
+#pragma warning disable SYSLIB1054
[DllImport("SDL2")]
private static extern int SDL_GetDefaultAudioInfo(IntPtr name, out SDL_AudioSpec spec, int isCapture);
+#pragma warning restore SYSLIB1054
public SDL2HardwareDeviceDriver()
{
@@ -90,7 +92,7 @@ namespace Ryujinx.Audio.Backends.SDL2
throw new NotImplementedException("Input direction is currently not implemented on SDL2 backend!");
}
- SDL2HardwareDeviceSession session = new SDL2HardwareDeviceSession(this, memoryManager, sampleFormat, sampleRate, channelCount, volume);
+ SDL2HardwareDeviceSession session = new(this, memoryManager, sampleFormat, sampleRate, channelCount, volume);
_sessions.TryAdd(session, 0);
@@ -135,8 +137,7 @@ namespace Ryujinx.Audio.Backends.SDL2
if (device == 0)
{
- Logger.Error?.Print(LogClass.Application,
- $"SDL2 open audio device initialization failed with error \"{SDL_GetError()}\"");
+ Logger.Error?.Print(LogClass.Application, $"SDL2 open audio device initialization failed with error \"{SDL_GetError()}\"");
return 0;
}
@@ -156,6 +157,7 @@ namespace Ryujinx.Audio.Backends.SDL2
public void Dispose()
{
+ GC.SuppressFinalize(this);
Dispose(true);
}