shout: pass void pointer to the encoder
Pass the music chunk as a "const void *" to the encoder, instead of a "const char *". Actually, both encoders currently expect 16 bit samples, passing a 8-bit character is rather pointless.
This commit is contained in:
parent
12756c1b55
commit
b27d9e055b
@ -134,8 +134,8 @@ static int shout_mp3_encoder_send_metadata(struct shout_data *sd,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int shout_mp3_encoder_encode(struct shout_data *sd,
|
static int
|
||||||
const char * chunk, size_t len)
|
shout_mp3_encoder_encode(struct shout_data *sd, const void *chunk, size_t len)
|
||||||
{
|
{
|
||||||
const int16_t *src = (const int16_t*)chunk;
|
const int16_t *src = (const int16_t*)chunk;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
@ -247,8 +247,9 @@ pcm16_to_ogg_buffer(float **dest, const int16_t *src,
|
|||||||
dest[j][i] = *src++ / 32768.0;
|
dest[j][i] = *src++ / 32768.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int shout_ogg_encoder_encode(struct shout_data *sd,
|
static int
|
||||||
const char *chunk, size_t size)
|
shout_ogg_encoder_encode(struct shout_data *sd,
|
||||||
|
const void *chunk, size_t size)
|
||||||
{
|
{
|
||||||
struct shout_buffer *buf = &sd->buf;
|
struct shout_buffer *buf = &sd->buf;
|
||||||
unsigned int samples;
|
unsigned int samples;
|
||||||
|
@ -36,7 +36,7 @@ struct shout_encoder_plugin {
|
|||||||
|
|
||||||
int (*clear_encoder_func)(struct shout_data *sd);
|
int (*clear_encoder_func)(struct shout_data *sd);
|
||||||
int (*encode_func)(struct shout_data *sd,
|
int (*encode_func)(struct shout_data *sd,
|
||||||
const char *chunk, size_t len);
|
const void *chunk, size_t len);
|
||||||
void (*finish_func)(struct shout_data *sd);
|
void (*finish_func)(struct shout_data *sd);
|
||||||
int (*init_func)(struct shout_data *sd);
|
int (*init_func)(struct shout_data *sd);
|
||||||
int (*init_encoder_func) (struct shout_data *sd);
|
int (*init_encoder_func) (struct shout_data *sd);
|
||||||
|
Loading…
Reference in New Issue
Block a user