ios - AVAssetWriterInput appendSampleBuffer crashing -
i have audiowriterbuffer appending audio sample buffers follows
func captureoutput(captureoutput: avcaptureoutput!, didoutputsamplebuffer samplebuffer: cmsamplebuffer!, fromconnection connection: avcaptureconnection!) { if cmsamplebufferdataisready(samplebuffer) <= 0 { return } if captureoutput == audiooutput && audiowriterbuffer != nil && audiowriterbuffer.readyformoremediadata == true { var audiotime = cmsamplebuffergetpresentationtimestamp(samplebuffer) audiowriterbuffer.appendsamplebuffer(samplebuffer) } }
it works supposed to. every once in while, crashes following error:
nsarray mutated while being enumerated.
at:
audiowriterbuffer.appendsamplebuffer(samplebuffer)
i don't understand relevance of that, or how solve it.
any clue?
Comments
Post a Comment