I've that function:
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
}
It sounds like EXC_BAD_ACCESS
comes from accessing deallocated variables, but I don't really see how that'd come into play here since I've checked all the variables I'm using before calling the line that fails.