This commit is contained in:
Alex Chronopoulos 2016-07-06 19:32:52 +03:00 коммит произвёл Paul Adenot
Родитель 9e90915eb1
Коммит 35cecb908b
1 изменённых файлов: 1 добавлений и 11 удалений

Просмотреть файл

@ -57,7 +57,7 @@ typedef UInt32 AudioFormatFlags;
#define CUBEB_AUDIOUNIT_SUBTYPE kAudioUnitSubType_HALOutput
#endif
//#define LOGGING_ENABLED
#define LOGGING_ENABLED
#ifdef LOGGING_ENABLED
#define LOG(...) do { \
fprintf(stderr, __VA_ARGS__); \
@ -999,11 +999,6 @@ audiounit_stream_init(cubeb * context,
// Use latency to calculate buffer size
stm->input_buffer_frames = (latency / 1000.0) * stm->input_hw_rate;
if (stm->input_buffer_frames % stm->input_desc.mBytesPerFrame) {
// Round up to next frame
stm->input_buffer_frames += stm->input_desc.mBytesPerFrame -
(stm->input_buffer_frames % stm->input_desc.mBytesPerFrame);
}
LOG("Calculated input number of frames %u for latency %u\n", stm->input_buffer_frames, latency);
if (AudioUnitSetProperty(stm->input_unit,
kAudioDevicePropertyBufferFrameSize,
@ -1103,11 +1098,6 @@ audiounit_stream_init(cubeb * context,
// device sampling rate, internal resampler of audiounit will
// calculate the expected number of frames.
uint32_t output_buffer_frames = (latency / 1000.0) * output_hw_desc.mSampleRate;
if (output_buffer_frames % stm->output_desc.mBytesPerFrame) {
// Round up to next frame
output_buffer_frames += stm->output_desc.mBytesPerFrame -
(output_buffer_frames % stm->output_desc.mBytesPerFrame);
}
LOG("Calculated output number of frames %u for latency %u\n", output_buffer_frames, latency);
if (AudioUnitSetProperty(stm->output_unit,
kAudioDevicePropertyBufferFrameSize,