[WIP] Voice chats

This commit is contained in:
Ali
2020-11-20 22:32:45 +04:00
parent c14d93229c
commit c86ceafb5c
24 changed files with 372 additions and 49 deletions

View File

@@ -179,10 +179,10 @@ private func readPacketCallback(userData: UnsafeMutableRawPointer?, buffer: Unsa
}
}
if let fetchedData = fetchedData {
precondition(fetchedData.count <= readCount)
assert(fetchedData.count <= readCount)
fetchedData.withUnsafeBytes { bytes -> Void in
precondition(bytes.baseAddress != nil)
memcpy(buffer, bytes.baseAddress, fetchedData.count)
memcpy(buffer, bytes.baseAddress, min(fetchedData.count, readCount))
}
fetchedCount = Int32(fetchedData.count)
context.readingOffset += Int(fetchedCount)