Changeset 3410


Ignore:
Timestamp:
Jan 31, 2011 11:27:48 AM (11 years ago)
Author:
ming
Message:

Re #1192: Fixes stereo support.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia-audiodev/coreaudio_dev.c

    r3406 r3410  
    661661 
    662662    ioData->mNumberBuffers = 1; 
    663     ioData->mBuffers[0].mNumberChannels = 1; 
     663    ioData->mBuffers[0].mNumberChannels = strm->streamFormat.mChannelsPerFrame; 
    664664    ioData->mBuffers[0].mData = strm->resample_buf_ptr; 
    665665    ioData->mBuffers[0].mDataByteSize = *ioNumberDataPackets * 
     666                                        strm->streamFormat.mChannelsPerFrame * 
    666667                                        strm->param.bits_per_sample >> 3; 
    667668 
     
    726727    if (nsamples >= resampleSize) { 
    727728        pjmedia_frame frame; 
    728         UInt32 resampleOutput = strm->param.samples_per_frame; 
     729        UInt32 resampleOutput = strm->param.samples_per_frame / 
     730                                strm->streamFormat.mChannelsPerFrame; 
    729731        AudioBufferList ab; 
    730732 
     
    736738         
    737739        ab.mNumberBuffers = 1; 
    738         ab.mBuffers[0].mNumberChannels = 1; 
     740        ab.mBuffers[0].mNumberChannels = strm->streamFormat.mChannelsPerFrame; 
    739741        ab.mBuffers[0].mData = strm->rec_buf; 
    740742        ab.mBuffers[0].mDataByteSize = frame.size; 
     
    779781            strm->resample_buf_ptr = input; 
    780782            ab.mBuffers[0].mDataByteSize = frame.size; 
    781             resampleOutput = strm->param.samples_per_frame; 
     783            resampleOutput = strm->param.samples_per_frame / 
     784                             strm->streamFormat.mChannelsPerFrame; 
    782785            ostatus = AudioConverterFillComplexBuffer(strm->resample, 
    783786                                                      resampleProc, 
Note: See TracChangeset for help on using the changeset viewer.