Revert "Fix build"

This reverts commit 99746e7b478f40c02760666ef5d190098b1b8a9b.
This commit is contained in:
Isaac 2024-12-23 21:45:02 +08:00
parent caa94e9d03
commit 41ac4b5130

View File

@ -27,9 +27,15 @@ 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
}
@ -37,6 +43,10 @@ public extension HLSCodecConfiguration {
isSoftwareAv1Supported = value != 0.0
}
if "".isEmpty {
isSoftwareAv1Supported = false
}
self.init(isHardwareAv1Supported: isHardwareAv1Supported, isSoftwareAv1Supported: isSoftwareAv1Supported)
}
}