mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2026-03-11 18:05:32 +00:00
fix AppleHardwareDeviceDriver.IsSupported (no fancy check is needed; it's on any macOS version 10.5 (Leopard) and above)
This commit is contained in:
parent
5ed94c365b
commit
cc5b60bbca
1 changed files with 1 additions and 33 deletions
|
|
@ -83,39 +83,7 @@ namespace Ryujinx.Audio.Backends.Apple
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsSupported => IsSupportedInternal();
|
public static bool IsSupported => OperatingSystem.IsMacOSVersionAtLeast(10, 5);
|
||||||
|
|
||||||
private static bool IsSupportedInternal()
|
|
||||||
{
|
|
||||||
if (!OperatingSystem.IsMacOS()) return false;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
AudioStreamBasicDescription format =
|
|
||||||
GetAudioFormat(SampleFormat.PcmInt16, Constants.TargetSampleRate, 2);
|
|
||||||
int result = AudioQueueNewOutput(
|
|
||||||
ref format,
|
|
||||||
nint.Zero,
|
|
||||||
nint.Zero,
|
|
||||||
nint.Zero,
|
|
||||||
nint.Zero,
|
|
||||||
0,
|
|
||||||
out nint testQueue);
|
|
||||||
|
|
||||||
if (result == 0)
|
|
||||||
{
|
|
||||||
AudioQueueDispose(testQueue, true);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Logger.Error?.Print(LogClass.Audio, $"Failed to check if AudioToolbox is supported: {e.Message}\n{e.StackTrace}");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ManualResetEvent GetUpdateRequiredEvent()
|
public ManualResetEvent GetUpdateRequiredEvent()
|
||||||
=> _updateRequiredEvent;
|
=> _updateRequiredEvent;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue