summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
9943be4)
The function depends on the caller not passing a smaller value than
the packet size - WMA_FRAME_SKIP, and only uses this many input
bytes anyway. So we may get rid of the input size argument.
}
static int wma_decode_superframe(struct private_wmadec_data *pwd, void *data,
}
static int wma_decode_superframe(struct private_wmadec_data *pwd, void *data,
- int *data_size, const uint8_t *buf, int buf_size)
+ int *data_size, const uint8_t *buf)
+ int ret, buf_size = pwd->ahi.packet_size - WMA_FRAME_SKIP;
- buf_size = pwd->ahi.packet_size - WMA_FRAME_SKIP;
samples = data;
init_get_bits(&pwd->gb, buf, buf_size);
if (pwd->ahi.use_bit_reservoir) {
samples = data;
init_get_bits(&pwd->gb, buf, buf_size);
if (pwd->ahi.use_bit_reservoir) {
out_size = WMA_OUTPUT_BUFFER_SIZE;
out = para_malloc(out_size);
ret = wma_decode_superframe(pwd, out, &out_size,
out_size = WMA_OUTPUT_BUFFER_SIZE;
out = para_malloc(out_size);
ret = wma_decode_superframe(pwd, out, &out_size,
- (uint8_t *)in + WMA_FRAME_SKIP, len - WMA_FRAME_SKIP);
+ (uint8_t *)in + WMA_FRAME_SKIP);
if (ret < 0) {
free(out);
goto err;
if (ret < 0) {
free(out);
goto err;