Skip to content

Commit 41ac4b5

Browse files
author
Isaac
committed
Revert "Fix build"
This reverts commit 99746e7.
1 parent caa94e9 commit 41ac4b5

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

submodules/TelegramUniversalVideoContent/Sources/HLSVideoContent.swift

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,26 @@ public struct HLSCodecConfiguration {
2727

2828
public extension HLSCodecConfiguration {
2929
init(context: AccountContext) {
30-
var isHardwareAv1Supported = internal_isHardwareAv1Supported
3130
var isSoftwareAv1Supported = false
3231

32+
var length: Int = 4
33+
var cpuCount: UInt32 = 0
34+
sysctlbyname("hw.ncpu", &cpuCount, &length, nil, 0)
35+
if cpuCount >= 6 {
36+
isSoftwareAv1Supported = true
37+
}
38+
3339
if let data = context.currentAppConfiguration.with({ $0 }).data, let value = data["ios_enable_hardware_av1"] as? Double {
3440
isHardwareAv1Supported = value != 0.0
3541
}
3642
if let data = context.currentAppConfiguration.with({ $0 }).data, let value = data["ios_enable_software_av1"] as? Double {
3743
isSoftwareAv1Supported = value != 0.0
3844
}
3945

46+
if "".isEmpty {
47+
isSoftwareAv1Supported = false
48+
}
49+
4050
self.init(isHardwareAv1Supported: isHardwareAv1Supported, isSoftwareAv1Supported: isSoftwareAv1Supported)
4151
}
4252
}

0 commit comments

Comments
 (0)