mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-05-08 06:15:48 +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:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user