output/shout: remove shout_buffer.len
Make it a local variable instead.
This commit is contained in:
parent
c7748fedab
commit
fe8fc1081a
@ -38,7 +38,6 @@
|
|||||||
|
|
||||||
struct shout_buffer {
|
struct shout_buffer {
|
||||||
unsigned char data[32768];
|
unsigned char data[32768];
|
||||||
size_t len;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct shout_data {
|
struct shout_data {
|
||||||
@ -347,12 +346,12 @@ write_page(struct shout_data *sd, GError **error)
|
|||||||
{
|
{
|
||||||
assert(sd->encoder != NULL);
|
assert(sd->encoder != NULL);
|
||||||
|
|
||||||
sd->buf.len = encoder_read(sd->encoder,
|
size_t nbytes = encoder_read(sd->encoder,
|
||||||
sd->buf.data, sizeof(sd->buf.data));
|
sd->buf.data, sizeof(sd->buf.data));
|
||||||
if (sd->buf.len == 0)
|
if (nbytes == 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
int err = shout_send(sd->shout_conn, sd->buf.data, sd->buf.len);
|
int err = shout_send(sd->shout_conn, sd->buf.data, nbytes);
|
||||||
if (!handle_shout_error(sd, err, error))
|
if (!handle_shout_error(sd, err, error))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -361,8 +360,6 @@ write_page(struct shout_data *sd, GError **error)
|
|||||||
|
|
||||||
static void close_shout_conn(struct shout_data * sd)
|
static void close_shout_conn(struct shout_data * sd)
|
||||||
{
|
{
|
||||||
sd->buf.len = 0;
|
|
||||||
|
|
||||||
if (sd->encoder != NULL) {
|
if (sd->encoder != NULL) {
|
||||||
if (encoder_end(sd->encoder, NULL))
|
if (encoder_end(sd->encoder, NULL))
|
||||||
write_page(sd, NULL);
|
write_page(sd, NULL);
|
||||||
@ -437,8 +434,6 @@ my_shout_open_device(struct audio_output *ao, struct audio_format *audio_format,
|
|||||||
if (!shout_connect(sd, error))
|
if (!shout_connect(sd, error))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
sd->buf.len = 0;
|
|
||||||
|
|
||||||
if (!encoder_open(sd->encoder, audio_format, error)) {
|
if (!encoder_open(sd->encoder, audio_format, error)) {
|
||||||
shout_close(sd->shout_conn);
|
shout_close(sd->shout_conn);
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user