在进行Swift转换时,我收到了一个错误:
二元运算符+ =不能应用于' UnsafeMutablePointer类型的操作数?'和' Int'
我的代码:
var avpkt = AVPacket()
var p : UnsafeMutablePointer<UInt8>? = nil
avpkt.data = UnsafeMutablePointer<UInt8>(mutating: inbuf)
p = avpkt.data
p += Int(avpkt.size) // error at this line