Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

偶现奔溃:-[AVAssetWriterInput appendSampleBuffer:] Cannot append sample buffer: Must start a session (using -[AVAssetWriter startSessionAtSourceTime:) first #737

Open
jumpingfrog0 opened this issue Oct 22, 2024 · 1 comment

Comments

@jumpingfrog0
Copy link

在拍摄视频过程中,退后台再回前台,偶发崩溃,遇到过2次

奔溃1:
EXC_CRASH (SIGABRT)
*** -[AVAssetWriterInput appendSampleBuffer:] Cannot append sample buffer: Must start a session (using -[AVAssetWriter startSessionAtSourceTime:) first

image

奔溃2:
EXC_CRASH (SIGABRT)
*** -[AVAssetWriterInputPixelBufferAdaptor appendPixelBuffer:withPresentationTime:] Must start a session (using -[AVAssetWriter startSessionAtSourceTime:) before appending pixel buffers

image

崩溃之后重新打开APP就无法拍摄,重启手机后又正常了。

怀疑是 didStartWriter 没有正确重置回 false 导致 assetWriter.startSession(atSourceTime: startTimeToUse) 没有调用导致的,但还不知道是什么原因。
image

@jumpingfrog0
Copy link
Author

多线程访问可能会导致这个问题?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant