Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: scaudiocompress questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: scaudiocompress questions




On 7-jun-07, at 21:09, Brad Ford wrote:

HHello,

I have a few questions about the sample code:

    
Before each call to SCAudioFillBuffer the code does this:

    for (i = 0; i < abl->mNumberBuffers; i++)
    {
      abl->mBuffers[i].mNumberChannels = (abl->mNumberBuffers > 1 ? 1 : asbd.mChannelsPerFrame);
      abl->mBuffers[i].mDataByteSize = bufferSize;
      abl->mBuffers[i].mData = ptr;
      ptr = (UInt8*)ptr + bufferSize;
    }

Can't this be taken out of the compression loop?

Yes, as used in scaudiocompress, this is actually one-time initialization code.  It would, however, be necessary if the bufferSize were changing on every pull (e.g. if you were pulling for different amounts each time), so I left it in as "belt and suspenders" code.

I actually had a bug in my audio handling that went away after I moved this code back into the loop. But I didn't check what was happening.
So I would advise to leave the sample code as it is.

Jan E.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.