Re: crashing in calls to AudioConverter on 10.3.9
Re: crashing in calls to AudioConverter on 10.3.9
- Subject: Re: crashing in calls to AudioConverter on 10.3.9
- From: Christopher Ashworth <email@hidden>
- Date: Tue, 28 Mar 2006 19:15:12 -0500
On Mar 28, 2006, at 5:39 PM, William Stewart wrote:
OK...
So, the SRC crash that you posted below has been tracked down to we
think a problem with the input that you are providing. It would
appear that the number of channels of audio data you are providing
in the ABL from your input callback is different than we're expecting
<snip>
So, please check that your input ABL is of the same format as the
source format you use to create the converter with.
Hmmm. I am confused.
I was, I see, failing to set the number of channels in the ioData
audio buffer list that my converter input proc is filling. I fixed
this, and the audio buffer list in my converter input callback is now
set by:
ioData->mBuffers[0].mData = conversionBuffer;
ioData->mBuffers[0].mDataByteSize = conversionBufferByteCount;
ioData->mBuffers[0].mNumberChannels = fileInputChannels; // <-- this
line added
So far so good. (Although this change alone hasn't fixed the crash.)
I am confused, however, when you ask me to check that the input ABL
is the same format as the source format of the converter.
By input ABL, I understand you to mean the ioData ABL that I am
filling in the converter callback. (i.e. the one I am setting with
the three lines above.) The number of channels is now being set
correctly, which only leaves the mData and mDataByteSize fields.
These fields are being set to the results of a call to
AudioFileReadPackets: conversionBuffer and
conversionBufferByteCount. conversionBuffer is allocated according
to the description in the developer docs. (Namely: "user allocated
memory of size: number of packets requested times file's maximum (or
upper bound on) packet size.")
The explicit allocation is:
conversionBuffer = (void *)calloc(1, fileMaxPacketSize *
bufferSizeInFilePackets);
Now, when you say that the ABL should be set to the proper format, I
am confused about how this translates to the process described
above. Are you referring to how I calculate the size of the
conversionBuffer, i.e. making sure that the size of the buffer is big
enough to hold the format in question?
Thanks very much,
Chris
_______________________________________________
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