Strange AQDefaultDevice logging

I am playing video from a controller like this:

func playMovie() {
    let path = Bundle.main.path(forResource: "xyz", ofType:"mov")
    let url = URL(fileURLWithPath: path!)

    self.player = AVPlayer(url: url)
    let layer: AVPlayerLayer = AVPlayerLayer(player: self.player)

    layer.frame = self.view.frame
    layer.videoGravity = AVLayerVideoGravityResizeAspectFill
    self.view.layer.addSublayer(layer)

    self.player.play()
}

Even after the controller is destroyed and no longer in use, I get this log message every second or so:

AQDefaultDevice (173): skipping input stream 0 0 0x0

I am not asking how to hide these logs. I know how to do that by setting OS_ACTIVITY_MODE to disable (See this for how to hide these logs). My concern is that the movie may be still playing somehow even after the controller is destroyed. Is there anything wrong in the way I am playing the movie. Or do I need to perform any additional cleanup?


Solution 1:

No, you do nothing wrong. This is a bug with logs in Xcode8 + iOS10.


We can get round it in this way (device and simulator need different values):

Add the Name OS_ACTIVITY_MODE and the Value ${DEBUG_ACTIVITY_MODE} and check it (in Product -> Scheme -> Edit Scheme -> Run -> Arguments -> Environment).

enter image description here

Add User-Defined Setting DEBUG_ACTIVITY_MODE, then add Any iOS Simulator SDK for Debug and set it's value to disable (in Project -> Build settings -> + -> User-Defined Setting)

enter image description here

Solution 2:

I got this problem when i using AVPlayer Foundation on iOS Simulator (xcode 8.1).However it doesn't log anymore on iOS devices. In my opinion it's a log bug.The player or the layer is destroyed.


update

i got this for you fix unwanted log messages