Re: AudioFileClose() crashing on iOS after playback
Re: AudioFileClose() crashing on iOS after playback
- Subject: Re: AudioFileClose() crashing on iOS after playback
- From: Kyle Sluder <email@hidden>
- Date: Sat, 2 Oct 2010 18:46:22 -0700
On Oct 2, 2010, at 3:54 PM, Chris Santoro <email@hidden> wrote:
> I want to start playing a file given some CFString theFilePath which I do not own. I want to use AudioFileOpenURL, so I first I create a URL.
>
> CFURLRef audioFileURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, theFilePath, kCFURLPOSIXPathStyle, false);
>
> Then I open the audio file, where mPlaybackFile is a member of the class that's currently doing all this.
>
> AudioFileOpenURL (audioFileURL, kAudioFileReadPermission, 0, &mPlaybackFile);
>
> I've got my file handle (mPlaybackFile), and now (I think) I don't need the URL I used to open the file. So I release it.
> CFRelease(audioFileURL);
Unless Core Audio is not following the CF memory management rules, you need to retain mPlaybackFile.
--Kyle Sluder _______________________________________________
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