LivePhoto icon indicating copy to clipboard operation
LivePhoto copied to clipboard

Get Crash about AVAssetReaderTrackOutput

Open icefox57 opened this issue 2 years ago • 2 comments

image

2 kind of crash

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '*** -[AVAssetReaderTrackOutput copyNextSampleBuffer] cannot copy next sample buffer before adding this output to an instance of AVAssetReader (using -addOutput:) and calling -startReading on that asset reader'

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '*** -[AVAssetReader startReading] cannot be called again after reading has already started' terminating with uncaught exception of type NSException

icefox57 avatar Feb 11 '23 07:02 icefox57

Hi. I'm having the same issue. Have you found any solutions?

ThuTruongMinu avatar Aug 11 '23 10:08 ThuTruongMinu

I believe it's an issue having to do with concurrency, and multiple calls to addAssetID sharing the same audioReader, videoReader, and assetWriter. I fixed this by moving those three variables into the top of addAssetID (and cleaning up all references to self. for each of them).

nathan-ahn avatar Dec 18 '23 18:12 nathan-ahn