Fix invalid assert ... system_buffer_size can be modified lower

This commit is contained in:
Aaron Culliney 2015-09-07 11:05:22 -07:00
parent 411e474c4b
commit ef7472b3ac

View File

@ -231,7 +231,9 @@ static void _submit_samples_buffer_fullspeed(void) {
if (speakerBuffer->Lock(speakerBuffer, num_samples_pad*sizeof(int16_t), &system_samples_buffer, &system_buffer_size)) {
return;
}
assert(num_samples_pad <= system_buffer_size);
if (num_samples_pad > system_buffer_size/sizeof(int16_t)) {
num_samples_pad = system_buffer_size/sizeof(int16_t);
}
//SPEAKER_LOG("bytes_queued:%d enqueueing %d quiet samples", bytes_queued, num_samples_pad);
for (unsigned int i=0; i<num_samples_pad; i++) {