0
0
Fork 0
This repository has been archived on 2024-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
ryujinx-final/Ryujinx.HLE/HOS/Services/Audio/Types/OpusPacketHeader.cs
Thomas Guillemard 9142aca48f Fix hwopus DecodeInterleaved implementation (#786)
* Fix hwopus DecodeInterleaved implementation

Also implement new variants of this api.

This should fix #763

* Sample rate shouldn't be hardcoded

This fix issues while opening Pokémon Let's Go pause menu.

* Apply Ac_K's suggestion about EndianSwap

* Address gdkchan's comment

* Address Ac_k's comment
2019-10-11 17:22:24 +02:00

24 lines
668 B
C#

using Ryujinx.Common;
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Audio.Types
{
[StructLayout(LayoutKind.Sequential)]
struct OpusPacketHeader
{
public uint length;
public uint finalRange;
public static OpusPacketHeader FromStream(BinaryReader reader)
{
OpusPacketHeader header = reader.ReadStruct<OpusPacketHeader>();
header.length = EndianSwap.FromBigEndianToPlatformEndian(header.length);
header.finalRange = EndianSwap.FromBigEndianToPlatformEndian(header.finalRange);
return header;
}
}
}