mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Fix crash
This commit is contained in:
parent
f5ca2503da
commit
781355b477
@ -133,7 +133,14 @@ private func rendererInputProc(refCon: UnsafeMutableRawPointer, ioActionFlags: U
|
||||
|
||||
var samplePtr = bufferData.advanced(by: dataOffset).assumingMemoryBound(to: Int16.self)
|
||||
for _ in 0 ..< actualConsumedCount / 4 {
|
||||
let sample: Int16 = abs(samplePtr.pointee)
|
||||
var sample: Int16 = samplePtr.pointee
|
||||
if sample < 0 {
|
||||
if sample <= -32768 {
|
||||
sample = Int16.max
|
||||
} else {
|
||||
sample = -sample
|
||||
}
|
||||
}
|
||||
samplePtr = samplePtr.advanced(by: 2)
|
||||
|
||||
if context.audioLevelPeak < sample {
|
||||
|
Loading…
x
Reference in New Issue
Block a user