Re: AVAssetReader crashing under 10.8.2
Re: AVAssetReader crashing under 10.8.2
- Subject: Re: AVAssetReader crashing under 10.8.2
- From: Christopher Ashworth <email@hidden>
- Date: Wed, 02 Oct 2013 11:52:30 -0400
Hi again all,
I'm happy to report that we eventually found a workaround for this, which I'll share here in hopes of helping some future developer searching through the archives:
It appears that Apple's code has a race condition when you cancel an AVAssetReader that is still spinning up from a call to startReading.
We managed to mostly (entirely?) avoid this crash by adding a delay of 200ms before our call to cancelReading, which in our code can sometimes happen quickly after we call startReading. e.g.:
AVAssetReader *localReader = _reader; // local variables are retained by blocks double delayInSeconds = 0.2; dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); dispatch_after(popTime, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void){ [localReader cancelReading]; });
Hope that helps someone,
Chris On Aug 14, 2013, at 9:57 AM, Christopher Ashworth < email@hidden> wrote: HI all,
We're also encountering this crash in the AQClient thread, now in 10.8.4. It has been difficult for us to recreate ourselves, but it's far and away our most common crash.
I spoke with the original poster (Michael) off list and it sounds like our scenarios are similar: we're both handling all buffering, playback, and sync directly. We use AVAssetReader to extract and then buffer frames on a background thread.
In our case, our code can operate both reading using CoreAudio (ExtAudioFileRef) or AVAssetReader. The two code paths have minimal differences, except for this crash.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden