mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
sbc: fix signedness of parameters
The written parameter of sbc_encode can be negative so it should be ssize_t instead of size_t.
This commit is contained in:
parent
fd7dc68ded
commit
177948a6f2
2 changed files with 6 additions and 5 deletions
|
|
@ -742,7 +742,7 @@ static int sbc_analyze_audio(struct sbc_encoder_state *state,
|
|||
* -99 not implemented
|
||||
*/
|
||||
|
||||
static SBC_ALWAYS_INLINE int sbc_pack_frame_internal(
|
||||
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)
|
||||
{
|
||||
|
|
@ -858,7 +858,7 @@ static SBC_ALWAYS_INLINE int sbc_pack_frame_internal(
|
|||
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) {
|
||||
|
|
@ -1004,10 +1004,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);
|
||||
|
|
|
|||
|
|
@ -90,7 +90,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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue