In my case, I play movie when app on foreground, when app switch to background mode, I need to stop playing. So when the movie is going to be played, switch to background mode immediately, then it crashed.
I played movie by url.
I debug the code, found it crashed in the function startProcessing :
I figured out that the loadValuesAsynchronouslyForKeys too slow cause this kind of crash. In my case, I already called the endProcessing to stop playing, but the loading for asset is too slow on iPhone 5s 10.1.1, the completionHandler of loading is delayed.
In my opinion, there should create a mechanism to stop processing immediately to avoid this case. such as a reversible atomic process to stop processing immediately.
Cause this issue only occurred on old device on its highest os version, maybe this issue is unnecessary to be fix, just a reminder for someone who encounter same issue with me.
I used subclass with method swizzling for processAsset and readNextVideoFrameFromOutput methods to resolve this issue temporarily.
Hope this clue will help to solve the bad performance caused issue on iphone 5/5s/5c of its 10.1.1+ os version
In my case, I play movie when app on foreground, when app switch to background mode, I need to stop playing. So when the movie is going to be played, switch to background mode immediately, then it crashed.
I played movie by url.
I debug the code, found it crashed in the function startProcessing :
I figured out that the loadValuesAsynchronouslyForKeys too slow cause this kind of crash. In my case, I already called the endProcessing to stop playing, but the loading for asset is too slow on iPhone 5s 10.1.1, the completionHandler of loading is delayed.
In my opinion, there should create a mechanism to stop processing immediately to avoid this case. such as a reversible atomic process to stop processing immediately.
Cause this issue only occurred on old device on its highest os version, maybe this issue is unnecessary to be fix, just a reminder for someone who encounter same issue with me.
I used subclass with method swizzling for processAsset and readNextVideoFrameFromOutput methods to resolve this issue temporarily.
Hope this clue will help to solve the bad performance caused issue on iphone 5/5s/5c of its 10.1.1+ os version