From f672e4016f9930cdf6700bafce0793657be61f9a Mon Sep 17 00:00:00 2001 From: Avuton Olrich Date: Sun, 30 Sep 2012 03:27:38 -0700 Subject: Modify version string to post-release version 0.17.3~git --- NEWS | 3 +++ 1 file changed, 3 insertions(+) (limited to 'NEWS') diff --git a/NEWS b/NEWS index 991f4b52..5ff83109 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +ver 0.17.3 (2012/??/??) + + ver 0.17.2 (2012/09/30) * protocol: - fix crash in local file check -- cgit v1.2.3 From c7748fedab96da650c81f8a9fad7ec61a3bd96df Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 1 Oct 2012 23:18:33 +0200 Subject: output/shout: fix memory leak in error handler --- NEWS | 3 ++- src/output/shout_output_plugin.c | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'NEWS') diff --git a/NEWS b/NEWS index 5ff83109..46963f30 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,6 @@ ver 0.17.3 (2012/??/??) - +* output: + - shout: fix memory leak in error handler ver 0.17.2 (2012/09/30) * protocol: diff --git a/src/output/shout_output_plugin.c b/src/output/shout_output_plugin.c index d6805f54..bebc5e5d 100644 --- a/src/output/shout_output_plugin.c +++ b/src/output/shout_output_plugin.c @@ -439,8 +439,13 @@ my_shout_open_device(struct audio_output *ao, struct audio_format *audio_format, sd->buf.len = 0; - if (!encoder_open(sd->encoder, audio_format, error) || - !write_page(sd, error)) { + if (!encoder_open(sd->encoder, audio_format, error)) { + shout_close(sd->shout_conn); + return false; + } + + if (!write_page(sd, error)) { + encoder_close(sd->encoder); shout_close(sd->shout_conn); return false; } -- cgit v1.2.3 From d34e55c370db54ace2543d9801d360dae8e7c494 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 2 Oct 2012 00:00:56 +0200 Subject: output/recorder: fix write() error check We can only check for negative values if the variable is signed. --- NEWS | 1 + src/output/recorder_output_plugin.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'NEWS') diff --git a/NEWS b/NEWS index 46963f30..a78002e9 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,6 @@ ver 0.17.3 (2012/??/??) * output: + - recorder: fix I/O error check - shout: fix memory leak in error handler ver 0.17.2 (2012/09/30) diff --git a/src/output/recorder_output_plugin.c b/src/output/recorder_output_plugin.c index 5d098f08..e2366bf9 100644 --- a/src/output/recorder_output_plugin.c +++ b/src/output/recorder_output_plugin.c @@ -140,9 +140,9 @@ recorder_output_encoder_to_file(struct recorder_output *recorder, size_t position = 0; while (true) { - size_t nbytes = write(recorder->fd, - recorder->buffer + position, - size - position); + ssize_t nbytes = write(recorder->fd, + recorder->buffer + position, + size - position); if (nbytes > 0) { position += (size_t)nbytes; if (position >= size) -- cgit v1.2.3 From adbe8c409a17b85ec10eb131fb81e3da9036dcef Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 1 Oct 2012 23:50:50 +0200 Subject: output/{recorder,shout}: call encoder_read() in a loop This is necessary for Ogg packets that span more than one page. --- NEWS | 1 + src/encoder_plugin.h | 2 ++ src/output/recorder_output_plugin.c | 19 +++++++++++-------- src/output/shout_output_plugin.c | 18 ++++++++++-------- 4 files changed, 24 insertions(+), 16 deletions(-) (limited to 'NEWS') diff --git a/NEWS b/NEWS index a78002e9..c08a779e 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ ver 0.17.3 (2012/??/??) * output: - recorder: fix I/O error check - shout: fix memory leak in error handler + - recorder, shout: support Ogg packets that span more than one page ver 0.17.2 (2012/09/30) * protocol: diff --git a/src/encoder_plugin.h b/src/encoder_plugin.h index cae0c804..3a42d79f 100644 --- a/src/encoder_plugin.h +++ b/src/encoder_plugin.h @@ -295,6 +295,8 @@ encoder_write(struct encoder *encoder, const void *data, size_t length, /** * Reads encoded data from the encoder. * + * Call this repeatedly until no more data is returned. + * * @param encoder the encoder * @param dest the destination buffer to copy to * @param length the maximum length of the destination buffer diff --git a/src/output/recorder_output_plugin.c b/src/output/recorder_output_plugin.c index ac4a5210..b84cb244 100644 --- a/src/output/recorder_output_plugin.c +++ b/src/output/recorder_output_plugin.c @@ -160,17 +160,20 @@ recorder_output_encoder_to_file(struct recorder_output *recorder, { assert(recorder->fd >= 0); - /* read from the encoder */ + while (true) { + /* read from the encoder */ - size_t size = encoder_read(recorder->encoder, recorder->buffer, - sizeof(recorder->buffer)); - if (size == 0) - return true; + size_t size = encoder_read(recorder->encoder, recorder->buffer, + sizeof(recorder->buffer)); + if (size == 0) + return true; - /* write everything into the file */ + /* write everything into the file */ - return recorder_write_to_file(recorder, recorder->buffer, size, - error_r); + if (!recorder_write_to_file(recorder, recorder->buffer, size, + error_r)) + return false; + } } static bool diff --git a/src/output/shout_output_plugin.c b/src/output/shout_output_plugin.c index 63f1001b..56456a0e 100644 --- a/src/output/shout_output_plugin.c +++ b/src/output/shout_output_plugin.c @@ -342,14 +342,16 @@ write_page(struct shout_data *sd, GError **error) { assert(sd->encoder != NULL); - size_t nbytes = encoder_read(sd->encoder, - sd->buffer, sizeof(sd->buffer)); - if (nbytes == 0) - return true; - - int err = shout_send(sd->shout_conn, sd->buffer, nbytes); - if (!handle_shout_error(sd, err, error)) - return false; + while (true) { + size_t nbytes = encoder_read(sd->encoder, + sd->buffer, sizeof(sd->buffer)); + if (nbytes == 0) + return true; + + int err = shout_send(sd->shout_conn, sd->buffer, nbytes); + if (!handle_shout_error(sd, err, error)) + return false; + } return true; } -- cgit v1.2.3