Skip to content

Commit 13c81e8

Browse files
author
Varun Naharia
committed
syedhali#16 Cannot convert value of type '(UnsafeMutableRawPointer, UInt32, UInt32, UnsafeRawPointer - fixed
1 parent 05452ba commit 13c81e8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

AudioStreamer/Parse/Parser+Packets.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010
import AVFoundation
1111
import os.log
1212

13-
func ParserPacketCallback(_ context: UnsafeMutableRawPointer, _ byteCount: UInt32, _ packetCount: UInt32, _ data: UnsafeRawPointer, _ packetDescriptions: UnsafeMutablePointer<AudioStreamPacketDescription>) {
13+
func ParserPacketCallback(_ context: UnsafeMutableRawPointer, _ byteCount: UInt32, _ packetCount: UInt32, _ data: UnsafeRawPointer, _ packetDescriptions: UnsafeMutablePointer<AudioStreamPacketDescription>?) {
1414
let parser = Unmanaged<Parser>.fromOpaque(context).takeUnretainedValue()
1515
let packetDescriptionsOrNil: UnsafeMutablePointer<AudioStreamPacketDescription>? = packetDescriptions
1616
let isCompressed = packetDescriptionsOrNil != nil
@@ -24,7 +24,7 @@ func ParserPacketCallback(_ context: UnsafeMutableRawPointer, _ byteCount: UInt3
2424
/// Iterate through the packets and store the data appropriately
2525
if isCompressed {
2626
for i in 0 ..< Int(packetCount) {
27-
let packetDescription = packetDescriptions[i]
27+
let packetDescription = packetDescriptions![i]
2828
let packetStart = Int(packetDescription.mStartOffset)
2929
let packetSize = Int(packetDescription.mDataByteSize)
3030
let packetData = Data(bytes: data.advanced(by: packetStart), count: packetSize)

0 commit comments

Comments
 (0)