AURemoteIO :: IOThread EXC_BAD_ACCESS

I am using AudioGraph. eqRenderInputis a callback function.

static OSStatus eqRenderInput(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData)
{
    @autoreleasepool {
    NSLog(@"--method = %s--current thread:%@",__func__,[NSThread currentThread]);
    MyAudioController *mycon = (__bridge MyAudioController *)inRefCon;
    AudioUnit mixUNIT = mycon->mixUnit;
    AudioUnitRender(mixUNIT, ioActionFlags, inTimeStamp, inBusNumber, inNumberFrames, ioData);

    int bufferCount = ioData->mNumberBuffers;
    NSLog(@"current thread:%@----bufferCount=%d",[NSThread currentThread],bufferCount);
    // Fill the provided AudioBufferList with the data from the AudioBufferList output by the audio data output
    for (int bufferIndex = 0; bufferIndex < bufferCount; bufferIndex++) {
        NSData *tmpData = [NSData dataWithBytes:ioData->mBuffers[bufferIndex].mData length:ioData->mBuffers[bufferIndex].mDataByteSize];
        [mycon->mixMArray addObject:tmpData];              // this line carsh
        NSLog(@"mchannel = %d---bufferIndex = %d",ioData->mBuffers[bufferIndex].mNumberChannels,bufferIndex);
     }
   }
}

mixMArrayclass NSMutableArray, [mycon->mixMArray addObject:tmpData];this line error, error message exec bad access code = 1 adddress = 0xf42e8.

+4
source share

All Articles