AVAssetWriter startSessionAtSourceTime:状态为 0 时无法调用方法

Nic*_*ini 6 iphone avfoundation ios

好吧,我很高兴地发现我的应用程序在从 Apple AppStore 下载的版本上崩溃了,而以前从未发生过。查看日志我得到了异常

AVAssetWriter startSessionAtSourceTime: Cannot call method when status is 0

显然这个错误在调试模式下不会发生。但它以前从未在发布模式下出现在另一个应用程序附带并在 appStore 上可用的代码中。

会不会是directoryForTemporaryFiles在iOS 8负责这个状态 0 的人中添加的?

Moh*_*med 6

startWriting()之前调用方法startSessionAtSourceTime()应该可以解决您的问题。