1
0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2025-01-13 05:21:56 -08:00

Fix a memory corruption in SoundIO wrapper ()

This fix audio slowdown on Unix based platforms where soundio will try
to switch to mono because of the invalid data written.
This commit is contained in:
Thomas Guillemard 2019-08-19 22:28:14 +02:00 committed by GitHub
parent 16aa2cfd62
commit 5c44c9600f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -64,7 +64,7 @@ namespace SoundIOSharp
get { unsafe { return new SoundIOChannelLayout ((IntPtr) ((void*) ((IntPtr) handle + layout_offset))); } }
set {
unsafe {
Buffer.MemoryCopy ((void*)((IntPtr)handle + layout_offset), (void*)value.Handle,
Buffer.MemoryCopy ((void*)value.Handle, (void*)((IntPtr)handle + layout_offset),
Marshal.SizeOf<SoundIoChannelLayout> (), Marshal.SizeOf<SoundIoChannelLayout> ());
}
}