Can't continue reading from AVAssetReaderOutput after going to background and back to foreground
Can't continue reading from AVAssetReaderOutput after going to background and back to foreground
- Subject: Can't continue reading from AVAssetReaderOutput after going to background and back to foreground
- From: Dan Raviv <email@hidden>
- Date: Fri, 05 Apr 2013 12:28:41 +0300
Hi all,
I'm using an AVAssetReaderOutput to read samples from an AVAsset, do some processing on them, and play the result using a RemoteIO AU.
The problem is that after calling AudioOutputUnitStop to pause the playback, then after going to the background and back to the foreground the audio won't start again after callingAudioOutputUnitStart. This is due to an error returned from the copyNextSampleBuffer method of AVAssetReaderOutput, which is called as part of the rendering pipeline.
The status property of AVAssetReader after calling copyNextSampleBuffer is
AVAssetReaderStatusFailed, and its error property is
Error Domain=AVFoundationErrorDomain Code=-11847 "Operation Interrupted" UserInfo=0x1d8b6100 {NSLocalizedRecoverySuggestion=Stop other operations and try again., NSLocalizedDescription=Operation Interrupted}
I'm looking for a solution which won't force me to reinitialize the entire pipeline after coming back to the foreground - Hoping there is such a solution, that AVAssetReaders can survive the app going to background and back...
Notes:
- The app is entitled to play audio in the background.
- I'm handling audio interruptions - Setting my AVAudioSession as the active one both onAVAudioSessionDelegates endInterruptionWithFlags: event and whenever the app becomes active. Doesn't make a difference whether I do this or not, getting the same error.
Let me know if sample code will help and I'll post that as well.
Thanks,
Dan
_______________________________________________
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