shout_mp3: cast input buffer to int16_t*
It's easier to work with an int16_t* pointer here.
This commit is contained in:
parent
655ba6a637
commit
a7b692a1df
@ -131,6 +131,7 @@ static int shout_mp3_encoder_send_metadata(struct shout_data *sd,
|
|||||||
static int shout_mp3_encoder_encode(struct shout_data *sd,
|
static int shout_mp3_encoder_encode(struct shout_data *sd,
|
||||||
const char * chunk, size_t len)
|
const char * chunk, size_t len)
|
||||||
{
|
{
|
||||||
|
const int16_t *src = (const int16_t*)chunk;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
int j;
|
int j;
|
||||||
float (*lamebuf)[2];
|
float (*lamebuf)[2];
|
||||||
@ -148,8 +149,7 @@ static int shout_mp3_encoder_encode(struct shout_data *sd,
|
|||||||
|
|
||||||
for (i = 0; i < samples; i++) {
|
for (i = 0; i < samples; i++) {
|
||||||
for (j = 0; j < sd->audio_format.channels; j++) {
|
for (j = 0; j < sd->audio_format.channels; j++) {
|
||||||
lamebuf[j][i] = *((const int16_t *) chunk);
|
lamebuf[j][i] = *src++;
|
||||||
chunk += bytes;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user