Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is __cxa_throw safe to ignore with Core Audio?

A similar question has been asked.. but I wanted to make it more specific to core audio.. as some of us may have noticed core audio has very little room for error.

As the answer to the said question explains, __cxa_throw is a C++ unhandled exception, which can be ignored (this problem seems to be new with Xcode 4.5.1.. I've never seen it before as well)

can we say the same about core audio? What makes me nervous is that it has to do with formatting of the audio.. which a lot of my code depends on:

I'm trying to convert an AAC file unto lPCM..

output format:

// set up the PCM output format for conversion
streamer->PCMoutputFormat.mSampleRate = 44100.0;
streamer->PCMoutputFormat.mFormatID = kAudioFormatLinearPCM;
streamer->PCMoutputFormat.mFormatFlags = kAudioFormatFlagsCanonical;
streamer->PCMoutputFormat.mBytesPerPacket = 4;
streamer->PCMoutputFormat.mFramesPerPacket = 1;
streamer->PCMoutputFormat.mBytesPerFrame = 4;
streamer->PCMoutputFormat.mChannelsPerFrame = 2;
streamer->PCMoutputFormat.mBitsPerChannel = 16;

input format:

mSampleRate = 44100
mFormatID = 1633772320 (AAC)
mFormatFlags = 0
mBytesPerPacket = 0 
mFramesPerPacket = 1024
mBytesPerFrame = 0
mChannelsPerFrame = 2
mBitsPerChannel = 0

instance variables:

game.h

@interface Game : NSObject <GKSessionDelegate>
{
    AudioStreamer *streamer;
}

@property (nonatomic, assign) AudioStreamBasicDescription mediaItemInputFormat;

audioStreamer.h

@interface AudioStreamer : NSObject
{
    @public
        AudioStreamBasicDescription PCMoutputFormat;
        AudioConverterRef audioConverter;
}

setting up converter command in game.m (this is where the __cxa_throw unhandled exception is thrown!)

// set up converter
OSStatus result = AudioConverterNew(&_mediaItemInputFormat,
                                    &streamer->PCMoutputFormat,
                                    &streamer->audioConverter);
like image 414
abbood Avatar asked Nov 27 '12 12:11

abbood


1 Answers

If the exception didn't end up terminating the application then some other piece of code handled it. If you trust whatever piece of code that was then there's nothing to worry about.

like image 134
Pete Becker Avatar answered Sep 23 '22 01:09

Pete Becker