mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-31 01:20:44 +00:00
btstack_resample: validate num channels in init
This commit is contained in:
parent
0532fef7b5
commit
4245bf3de9
@ -42,10 +42,14 @@
|
||||
#include "btstack_resample.h"
|
||||
|
||||
void btstack_resample_init(btstack_resample_t * context, int num_channels){
|
||||
btstack_assert(num_channels <= BTSTACK_RESAMPLE_MAX_CHANNELS);
|
||||
|
||||
context->src_pos = 0;
|
||||
context->src_step = 0x10000; // default resampling 1.0
|
||||
context->last_sample[0] = 0;
|
||||
context->last_sample[1] = 0;
|
||||
int i;
|
||||
for (i = 0; i < num_channels; i++){
|
||||
context->last_sample[i] = 0;
|
||||
}
|
||||
context->num_channels = num_channels;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user