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
來自訪問重新分配的變量,但我實在不明白那怎麼會來這裏發揮作用,因爲我」在調用失敗的行之前,我已經檢查了所有使用的變量。