Sample rate shouldn't be hardcoded

This fix issues while opening Pokémon Let's Go pause menu.
This commit is contained in:
Thog 2019-10-11 03:17:23 +02:00
parent 43262e1f13
commit 2adf6f845b
No known key found for this signature in database
GPG key ID: 0CD291558FAFDBC6

View file

@ -1,7 +1,6 @@
using Concentus;
using Concentus.Enums;
using Concentus.Structs;
using Ryujinx.Common;
using Ryujinx.HLE.HOS.Services.Audio.Types;
using System;
using System.IO;
@ -11,8 +10,6 @@ namespace Ryujinx.HLE.HOS.Services.Audio.HardwareOpusDecoderManager
{
class IHardwareOpusDecoder : IpcService
{
private const int FixedSampleRate = 48000;
private int _sampleRate;
private int _channelsCount;
private bool _reset;
@ -25,12 +22,12 @@ namespace Ryujinx.HLE.HOS.Services.Audio.HardwareOpusDecoderManager
_channelsCount = channelsCount;
_reset = false;
_decoder = new OpusDecoder(FixedSampleRate, channelsCount);
_decoder = new OpusDecoder(sampleRate, channelsCount);
}
private ResultCode GetPacketNumSamples(out int numSamples, byte[] packet)
{
int result = OpusPacketInfo.GetNumSamples(packet, 0, packet.Length, _sampleRate);
int result = OpusPacketInfo.GetNumSamples(_decoder, packet, 0, packet.Length);
numSamples = result;