0
我有该功能:AVPlayerItemVideoOutput.copyPixelBuffer失败EXC_BAD_ACCESS
func retrievePixelBufferToDraw() -> CVPixelBuffer? {
let time = self.playerItem!.currentTime()
// this line is just added to make sure I can call something on self.videoOutput!
self.videoOutput!.hasNewPixelBuffer(forItemTime: time)
// raises EXC_BAD_ACCESS
let pixelBuffer = self.videoOutput!.copyPixelBuffer(forItemTime: time, itemTimeForDisplay: nil)
return pixelBuffer
}
这听起来像EXC_BAD_ACCESS
来自访问重新分配的变量,但我实在不明白那怎么会来这里发挥作用,因为我”在调用失败的行之前,我已经检查了所有使用的变量。