diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2010-06-30 11:55:11 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-07-29 19:48:29 -0700 |
commit | 82dc5650ecf44397d6231b1d5eefe4b1df29ca42 (patch) | |
tree | 20e34259db5df97617e18ed8eec893a07b60d187 | |
parent | 61c38c14862086f87f23e82ce56eaf336f396196 (diff) | |
download | sbc-82dc5650ecf44397d6231b1d5eefe4b1df29ca42.tar.gz |
sbc: Fix signedness of libsbc parameters
The written parameter of sbc_encode can be negative so it should be
ssize_t instead of size_t.
-rw-r--r-- | sbc/sbc.c | 9 | ||||
-rw-r--r-- | sbc/sbc.h | 2 | ||||
-rw-r--r-- | sbc/sbcenc.c | 2 |
3 files changed, 7 insertions, 6 deletions
@@ -743,7 +743,7 @@ static int sbc_analyze_audio(struct sbc_encoder_state *state, * -99 not implemented */ -static SBC_ALWAYS_INLINE int sbc_pack_frame_internal(uint8_t *data, +static SBC_ALWAYS_INLINE ssize_t sbc_pack_frame_internal(uint8_t *data, struct sbc_frame *frame, size_t len, int frame_subbands, int frame_channels, int joint) @@ -860,7 +860,7 @@ static SBC_ALWAYS_INLINE int sbc_pack_frame_internal(uint8_t *data, return data_ptr - data; } -static int sbc_pack_frame(uint8_t *data, struct sbc_frame *frame, size_t len, +static ssize_t sbc_pack_frame(uint8_t *data, struct sbc_frame *frame, size_t len, int joint) { if (frame->subbands == 4) { @@ -1005,10 +1005,11 @@ ssize_t sbc_decode(sbc_t *sbc, const void *input, size_t input_len, } ssize_t sbc_encode(sbc_t *sbc, const void *input, size_t input_len, - void *output, size_t output_len, size_t *written) + void *output, size_t output_len, ssize_t *written) { struct sbc_priv *priv; - int framelen, samples; + int samples; + ssize_t framelen; int (*sbc_enc_process_input)(int position, const uint8_t *pcm, int16_t X[2][SBC_X_BUFFER_SIZE], int nsamples, int nchannels); @@ -92,7 +92,7 @@ ssize_t sbc_decode(sbc_t *sbc, const void *input, size_t input_len, /* Encodes ONE input block into ONE output block */ ssize_t sbc_encode(sbc_t *sbc, const void *input, size_t input_len, - void *output, size_t output_len, size_t *written); + void *output, size_t output_len, ssize_t *written); /* Returns the output block size in bytes */ size_t sbc_get_frame_length(sbc_t *sbc); diff --git a/sbc/sbcenc.c b/sbc/sbcenc.c index b5e0541..3d3a7dc 100644 --- a/sbc/sbcenc.c +++ b/sbc/sbcenc.c @@ -50,7 +50,7 @@ static void encode(char *filename, int subbands, int bitpool, int joint, struct au_header au_hdr; sbc_t sbc; int fd, size, srate, codesize, nframes; - size_t encoded; + ssize_t encoded; ssize_t len; if (sizeof(au_hdr) != 24) { |