Как определить конец в цели C - PullRequest
0 голосов
/ 15 ноября 2010
OSStatus SetupBuffers(BG_FileInfo *inFileInfo)
{
int numBuffersToQueue = kNumberBuffers;
UInt32 maxPacketSize;
UInt32 size = sizeof(maxPacketSize);
// we need to calculate how many packets we read at a time, and how big a buffer we need
// we base this on the size of the packets in the file and an approximate duration for      each buffer

// first check to see what the max size of a packet is - if it is bigger
// than our allocation default size, that needs to become larger
OSStatus result = AudioFileGetProperty(inFileInfo->mAFID,   kAudioFilePropertyPacketSizeUpperBound, &size, &maxPacketSize);
AssertNoError("Error getting packet upper bound size", end);
bool isFormatVBR = (inFileInfo->mFileFormat.mBytesPerPacket == 0 || inFileInfo-   >mFileFormat.mFramesPerPacket == 0);

CalculateBytesForTime(inFileInfo->mFileFormat, maxPacketSize, 0.5/*seconds*/,  &mBufferByteSize, &mNumPacketsToRead);

// if the file is smaller than the capacity of all the buffer queues, always load it at  once
if ((mBufferByteSize * numBuffersToQueue) > inFileInfo->mFileDataSize)
inFileInfo->mLoadAtOnce = true;

if (inFileInfo->mLoadAtOnce)
{
UInt64 theFileNumPackets;
size = sizeof(UInt64);
result = AudioFileGetProperty(inFileInfo->mAFID, kAudioFilePropertyAudioDataPacketCount,   &size, &theFileNumPackets);
       AssertNoError("Error getting packet count for file", end);***>>>>this is where xcode says undefined<<<<***

      mNumPacketsToRead = (UInt32)theFileNumPackets;
      mBufferByteSize = inFileInfo->mFileDataSize;
      numBuffersToQueue = 1;
   } 

// Вот точная ошибка

метка "конец" используется, но не определена. У меня есть эта ошибка дважды

Ответы [ 2 ]

3 голосов
/ 15 ноября 2010

Если вы посмотрите на источник SoundEngine.cpp, из которого получен фрагмент, вы увидите, что он определен в следующей строке:

end:
    return result;

Это метка, к которой при переходе появляется ошибка.

1 голос
/ 17 ноября 2010

Хм, единственное место, где я могу найти AssertNoError, находится здесь Техническое примечание TN2113 .И у него совершенно другой формат.AssertNoError(theError, "couldn't unregister the ABL"); Где определено AssertNoError?

Пользователь @Jeremy P также упоминает этот документ.

...