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

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -