partially revert 30b087ab3, CoreAudio SDK uses "Frames"
authorRobin Gareus <robin@gareus.org>
Tue, 19 Sep 2017 02:46:02 +0000 (04:46 +0200)
committerRobin Gareus <robin@gareus.org>
Tue, 19 Sep 2017 02:47:10 +0000 (04:47 +0200)
libs/backends/coreaudio/coreaudio_pcmio.cc
libs/backends/coreaudio/coreaudio_pcmio.h

index 8b2f9255d3e6d9fde0431cb3318367ba744bd59d..480fa6f4243842f59c03fdf9963fe714e0cc5e78 100644 (file)
@@ -752,7 +752,7 @@ static void PrintStreamDesc (AudioStreamBasicDescription *inDesc)
        printf ("  Format ID:%.*s\n",        (int)sizeof(inDesc->mFormatID), (char*)&inDesc->mFormatID);
        printf ("  Format Flags:%X\n",       (unsigned int)inDesc->mFormatFlags);
        printf ("  Bytes per Packet:%d\n",   (int)inDesc->mBytesPerPacket);
-       printf ("  Samples per Packet:%d\n",  (int)inDesc->mSamplesPerPacket);
+       printf ("  Frames per Packet:%d\n",  (int)inDesc->mFramesPerPacket);
        printf ("  Bytes per Frame:%d\n",    (int)inDesc->mBytesPerFrame);
        printf ("  Channels per Frame:%d\n", (int)inDesc->mChannelsPerFrame);
        printf ("  Bits per Channel:%d\n",   (int)inDesc->mBitsPerChannel);
@@ -895,7 +895,7 @@ CoreAudioPCM::pcm_start (
                srcFormat.mFormatID = kAudioFormatLinearPCM;
                srcFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked | kLinearPCMFormatFlagIsNonInterleaved;
                srcFormat.mBytesPerPacket = sizeof(float);
-               srcFormat.mSamplesPerPacket = 1;
+               srcFormat.mFramesPerPacket = 1;
                srcFormat.mBytesPerFrame = sizeof(float);
                srcFormat.mChannelsPerFrame = chn_in;
                srcFormat.mBitsPerChannel = 32;
@@ -903,8 +903,8 @@ CoreAudioPCM::pcm_start (
                err = AudioUnitSetProperty(_auhal, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, AUHAL_INPUT_ELEMENT, &srcFormat, sizeof(AudioStreamBasicDescription));
                if (err != noErr) { errorMsg="kAudioUnitProperty_StreamFormat, Output"; _state = -6; goto error; }
 
-               err = AudioUnitSetProperty(_auhal, kAudioUnitProperty_MaximumSamplesPerSlice, kAudioUnitScope_Global, AUHAL_INPUT_ELEMENT, (UInt32*)&_samples_per_period, sizeof(UInt32));
-               if (err != noErr) { errorMsg="kAudioUnitProperty_MaximumSamplesPerSlice, Input"; _state = -6; goto error; }
+               err = AudioUnitSetProperty(_auhal, kAudioUnitProperty_MaximumFramesPerSlice, kAudioUnitScope_Global, AUHAL_INPUT_ELEMENT, (UInt32*)&_samples_per_period, sizeof(UInt32));
+               if (err != noErr) { errorMsg="kAudioUnitProperty_MaximumFramesPerSlice, Input"; _state = -6; goto error; }
        }
 
        if (chn_out > 0) {
@@ -912,7 +912,7 @@ CoreAudioPCM::pcm_start (
                dstFormat.mFormatID = kAudioFormatLinearPCM;
                dstFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked | kLinearPCMFormatFlagIsNonInterleaved;
                dstFormat.mBytesPerPacket = sizeof(float);
-               dstFormat.mSamplesPerPacket = 1;
+               dstFormat.mFramesPerPacket = 1;
                dstFormat.mBytesPerFrame = sizeof(float);
                dstFormat.mChannelsPerFrame = chn_out;
                dstFormat.mBitsPerChannel = 32;
@@ -920,8 +920,8 @@ CoreAudioPCM::pcm_start (
                err = AudioUnitSetProperty(_auhal, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, AUHAL_OUTPUT_ELEMENT, &dstFormat, sizeof(AudioStreamBasicDescription));
                if (err != noErr) { errorMsg="kAudioUnitProperty_StreamFormat Input"; _state = -5; goto error; }
 
-               err = AudioUnitSetProperty(_auhal, kAudioUnitProperty_MaximumSamplesPerSlice, kAudioUnitScope_Global, AUHAL_OUTPUT_ELEMENT, (UInt32*)&_samples_per_period, sizeof(UInt32));
-               if (err != noErr) { errorMsg="kAudioUnitProperty_MaximumSamplesPerSlice, Output"; _state = -5; goto error; }
+               err = AudioUnitSetProperty(_auhal, kAudioUnitProperty_MaximumFramesPerSlice, kAudioUnitScope_Global, AUHAL_OUTPUT_ELEMENT, (UInt32*)&_samples_per_period, sizeof(UInt32));
+               if (err != noErr) { errorMsg="kAudioUnitProperty_MaximumFramesPerSlice, Output"; _state = -5; goto error; }
        }
 
        /* read back stream descriptions */
index e6d82571f48d9ab2176fc5b460c0b8a6828826c7..5f9778e8456127b0a1da30da2a8770f3b4ca86ae 100644 (file)
@@ -126,7 +126,7 @@ public:
                        AudioUnitRenderActionFlags* ioActionFlags,
                        const AudioTimeStamp* inTimeStamp,
                        UInt32 inBusNumber,
-                       UInt32 inNumberSamples,
+                       UInt32 inNumberFrames,
                        AudioBufferList* ioData);
 
        void xrun_callback ();