Changeset 8

Show
Ignore:
Timestamp:
06/12/06 22:17:10 (2 years ago)
Author:
gbooker
Message:

Added ability to do mono output as well as fixed bug with Christoph Nageli' AVI importer...

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/A52/ACShepA52Decoder.cpp

    r3 r8  
    5858#endif 
    5959         
    60         for (int channels = 2; channels <= 6; channels++) { 
     60        for (int channels = 1; channels <= 6; channels++) { 
    6161                //      This decoder only takes an A/52 or AC-3 stream as it's input 
    6262                CAStreamBasicDescription theInputFormat1(48000, kAudioFormatAC3, 0, 256*6, 0, channels, 0, 0); 
     
    428428                 
    429429                switch(mOutputFormat.mChannelsPerFrame) { 
     430                        case 1: 
     431                                // Just mono 
     432                                a52_flags = A52_MONO | A52_ADJUST_LEVEL; 
     433                                break; 
     434                                 
    430435                        case 2: 
    431436                                // All we really need is stereophonic, baby  
     
    821826                ioInputDataByteSize = offset; 
    822827                ioNumberPackets = packet; 
    823     } else { 
     828        } 
     829        if( ioInputDataByteSize == 0) { 
    824830        CODEC_THROW(kAudioCodecNotEnoughBufferSpaceError); 
    825831    } 
    826832        //fprintf(stderr, "ACShepA52Codec::AppendInputData: Copying in %ld:%ld new bytes\n", ioNumberPackets, ioInputDataByteSize); 
    827833         
    828         if (firstInput) { 
     834        if (firstInput && ioInputDataByteSize != 0) { 
    829835                DetermineStreamParameters(); 
    830836        }