Skip to content
New issue

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

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

Already on GitHub? # to your account

Exception #76

Closed
JuanPabloBoero opened this issue Dec 2, 2016 · 7 comments
Closed

Exception #76

JuanPabloBoero opened this issue Dec 2, 2016 · 7 comments

Comments

@JuanPabloBoero
Copy link

JuanPabloBoero commented Dec 2, 2016

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '*** -[AVAssetReader addOutput:] cannot add an output that has already been added to another AVAssetReader'

I use the pod for a sampler app, where you shot many sounds quickly and update the wave form analyzer, from time to time i got that exception, let me paste where it did happen:

        let readerOutput = AVAssetReaderTrackOutput(track: assetTrack, outputSettings: outputSettingsDict)
        readerOutput.alwaysCopiesSampleData = false
        reader.add(readerOutput)  <<<--- HERE
@fulldecent
Copy link
Owner

Hmm... I have not seen this before. Has anyone else seen this?

@JuanPabloBoero
Copy link
Author

You can reproduce the exception, by updating the waveform very fast with different sounds.

@fulldecent
Copy link
Owner

Are you talking about updating the asset while the waveform is rendering?

@JuanPabloBoero
Copy link
Author

JuanPabloBoero commented Dec 18, 2016

I do not know for sure, i have 9 pads, each pad has a sound assigned, when i press a pad i update the waveform (one view) according to the sound assigned to that pad, if i press just one pad repeatedly very fast, it works fine, if i start multitouching, firing many pads at the same time (updating one instance of FDWaveFormView), it crashes, what i am thinking of right now as a workaround is to implement some kind of logic in the delegate callbacks or create an instance of FDWaveFormView for each pad to see if it is an issue of concurrence, or sending a nil asset to clean before rendering maybe.

@PavelKandziuba
Copy link

PavelKandziuba commented Apr 12, 2017

Also have that bug (((
In my case its 5-6 cells with short audio 1-2 seconds

@PavelKandziuba
Copy link

As a quick fix that helped reader.canAdd(readerOutput) == true. That is preventing crash.
But at least one cell in tableview with audio cells (7 on screen) with 20-30 % will be not rendered

@fulldecent
Copy link
Owner

Hello all, I moved the AVAssetReader into the instance class so that it is not recreated.

I believe this should fix the problem. If not, could you please reopen.

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

No branches or pull requests

3 participants