Fix build

This commit is contained in:
Isaac
2024-12-12 23:46:49 +08:00
parent 8b89834d15
commit 99746e7b47

View File

@@ -27,15 +27,9 @@ public struct HLSCodecConfiguration {
public extension HLSCodecConfiguration {
init(context: AccountContext) {
var isHardwareAv1Supported = internal_isHardwareAv1Supported
var isSoftwareAv1Supported = false
var length: Int = 4
var cpuCount: UInt32 = 0
sysctlbyname("hw.ncpu", &cpuCount, &length, nil, 0)
if cpuCount >= 6 {
isSoftwareAv1Supported = true
}
if let data = context.currentAppConfiguration.with({ $0 }).data, let value = data["ios_enable_hardware_av1"] as? Double {
isHardwareAv1Supported = value != 0.0
}
@@ -43,10 +37,6 @@ public extension HLSCodecConfiguration {
isSoftwareAv1Supported = value != 0.0
}
if "".isEmpty {
isSoftwareAv1Supported = false
}
self.init(isHardwareAv1Supported: isHardwareAv1Supported, isSoftwareAv1Supported: isSoftwareAv1Supported)
}
}