ExtAudioFileSetProperty barfs disgracefully on third call
ExtAudioFileSetProperty barfs disgracefully on third call
- Subject: ExtAudioFileSetProperty barfs disgracefully on third call
- From: Matthew Leon <email@hidden>
- Date: Sun, 01 Apr 2012 02:07:01 +0300
So, I have a line of code that goes a little something like this:
err = ExtAudioFileSetProperty(outFile, kExtAudioFileProperty_ClientDataFormat, sizeof(asbd), &asbd);
Now, the first two times I hit this line, everything is peachy. But the third time around, things get downright nasty.
Error code: -50.
Through debugging I'm able to determine that this has _nothing_ to do with absd. In fact, I can call this method on the _same_ file three times, and only the third time will it screw up. No matter which files, no matter how much time spent between calls, etc., the third time I call this function (and every time after) I end up with puke all over my shirt, and a little stub of an open m4a file left as a souvenir.
Little detail: The line is being called from within an NSInvocationOperation. But I'm not running these one at a time, serially, so it would seem really unlikely to be a threading issue.
It seems to me like there might be something that I'm not properly disposing of, but I have no clue what it could be, because everything going into that file looks totally kosher.
For giggles, I've included the code preceding the culprit call below, though I doubt it would be of much help.
Love,
Matthew
// use AudioFormat API to fill out the rest.
UInt32 size = sizeof(asbd);
OSStatus err = AudioFormatGetProperty(kAudioFormatProperty_FormatInfo, 0, NULL, &size, &asbd);
NSAssert1(noErr == err, @"AudioFormatGetProperty kAudioFormatProperty_FormatInfo: %i", err);
err = ExtAudioFileCreateWithURL ((__bridge CFURLRef)outputFileURL, kAudioFileM4AType, &asbd, NULL, kAudioFileFlags_EraseFile, &outFile);
NSAssert1(noErr == err, @"Error creating audio file: %i", err);
asbd = [si asbd];
err = ExtAudioFileSetProperty(outFile, kExtAudioFileProperty_ClientDataFormat, sizeof(asbd), &asbd);
_______________________________________________
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