wma: Drop unused argument from wma_decode_superframe().
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 11 Jun 2017 14:10:40 +0000 (16:10 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Thu, 6 Jul 2017 19:00:36 +0000 (21:00 +0200)
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.

wmadec_filter.c

index a76f77df0dbe18b018a3cdb64d1703bb1673b975..0c96dc6c986db4a4a00e3f43c613218a4f2e13db 100644 (file)
@@ -1041,12 +1041,11 @@ static int wma_decode_frame(struct private_wmadec_data *pwd, int16_t *samples)
 }
 
 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;
+       int ret, buf_size = pwd->ahi.packet_size - WMA_FRAME_SKIP;
        int16_t *samples;
 
-       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) {
@@ -1217,7 +1216,7 @@ next_buffer:
        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;