提交 f02db95d 编写于 作者: P Palana

coreaudio-encoder: Fix input buffer freeing in complex_input_data_proc

When the bitrate was set to 64 CoreAudio would call
complex_input_data_proc more than once, which in turn would cause
consumed bytes in the input buffer to be "freed" more than once (once
for every additional call of complex_input_data_proc and once in
aac_encode)
上级 4a75f79a
......@@ -366,8 +366,10 @@ static OSStatus complex_input_data_proc(AudioConverterRef inAudioConverter,
ca_encoder *ca = inUserData;
if (ca->bytes_read)
if (ca->bytes_read) {
da_erase_range(ca->input_buffer, 0, ca->bytes_read);
ca->bytes_read = 0;
}
if (ca->input_buffer.num < ca->in_bytes_required) {
*ioNumberDataPackets = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册