Changeset 525

Show
Ignore:
Timestamp:
05/18/07 03:17:12 (1 year ago)
Author:
dconrad
Message:

Avoid returning 0 for kAudioCodecPropertyPacketFrameSize as this can crash on Intel.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/FFissionCodec/FFissionCodec.cpp

    r513 r525  
    135135                         
    136136                case kAudioCodecPropertyPacketFrameSize: 
    137                         if (avContext
     137                        if (avContext && avContext->frame_size
    138138                                *reinterpret_cast<UInt32*>(outPropertyData) = avContext->frame_size; 
     139                        else if (mInputFormat.mFramesPerPacket) 
     140                                *reinterpret_cast<UInt32*>(outPropertyData) = mInputFormat.mFramesPerPacket; 
    139141                        else 
    140                                 *reinterpret_cast<UInt32*>(outPropertyData) = mInputFormat.mFramesPerPacket; 
     142                                // not perfect but returning 0 can crash on intel 
     143                                *reinterpret_cast<UInt32*>(outPropertyData) = 1; 
    141144                        break; 
    142145