wulkano / Aperture

Record the screen on macOS
MIT License
1.24k stars 111 forks source link

External audio devices are not getting released after stopping the recording. #54

Open Sureshkumars opened 6 years ago

sindresorhus commented 6 years ago

"Released" in what sense? Can you elaborate?

Sureshkumars commented 6 years ago

@sindresorhus Please check your email. Have shared the videos which explain the issue clearly. Let me know if you need any more information.

Sureshkumars commented 6 years ago

@sindresorhus Found the issue. The reason why the audio output is not released is, aperture process gets killed before session.stoprunning gets completed. Adding a dispatch queue timer for 5 seconds or adding notification observer for the capture session solves the issue.

sindresorhus commented 6 years ago

Adding a dispatch queue timer for 5 seconds or adding notification observer for the capture session solves the issue.

That's weird because according to the docs, the stopRunning() method is synchronous:

This method is used to stop the flow of data from the inputs to the outputs connected to the AVCaptureSession instance that is the receiver. This method is synchronous and blocks until the receiver has completely stopped running. - https://developer.apple.com/documentation/avfoundation/avcapturesession/1385661-stoprunning#

And the process is not force killed, so it should be able to finish.