remove unnecessary code

This commit is contained in:
madwind 2025-01-15 23:26:56 +08:00
parent dfbcdfa83a
commit e1cb957d7b

View File

@ -79,8 +79,6 @@ namespace Ryujinx.Audio.Backends.SDL3
private unsafe void Update(nint userdata, nint stream, int additional_amount, int total_amount)
{
Span<byte> streamSpan = new((void*)stream, additional_amount);
int maxFrameCount = (int)GetSampleCount(additional_amount);
int bufferedFrames = _ringBuffer.Length / _bytesPerFrame;
@ -88,9 +86,6 @@ namespace Ryujinx.Audio.Backends.SDL3
if (frameCount == 0)
{
// SDL3 left the responsibility to the user to clear the buffer.
streamSpan.Clear();
return;
}
@ -102,15 +97,11 @@ namespace Ryujinx.Audio.Backends.SDL3
_ringBuffer.Read(samples, 0, samples.Length);
fixed (byte* pSrc = samples)
fixed (byte* pDst = destinationBuffer)
fixed (byte* pSrc = samples, pDst = destinationBuffer)
{
nint pStreamSrc = (nint)pSrc;
nint pStreamDst = (nint)pDst;
// Zero the dest buffer
streamSpan.Clear();
// Apply volume to written data
SDL_MixAudio(pStreamDst, pStreamSrc, _nativeSampleFormat, (uint)samples.Length, _driver.Volume);
SDL_PutAudioStreamData(stream, pStreamSrc, samples.Length);