aboutsummaryrefslogtreecommitdiff
path: root/src/decoder_thread.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-14 23:53:04 +0100
committerMax Kellermann <max@duempel.org>2009-12-15 23:12:11 +0100
commit228b03edf8513aa1cdaf4e4647279cc580245555 (patch)
tree7f5b03a9727fb8c371885469296eb7f49f6fa68b /src/decoder_thread.c
parentd000d31355c824a076324b647a3f056aab9ddabe (diff)
input_stream: return errors with GError
Diffstat (limited to 'src/decoder_thread.c')
-rw-r--r--src/decoder_thread.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/decoder_thread.c b/src/decoder_thread.c
index c055d2a3..9f297ad0 100644
--- a/src/decoder_thread.c
+++ b/src/decoder_thread.c
@@ -63,8 +63,16 @@ static bool
decoder_input_stream_open(struct decoder_control *dc,
struct input_stream *is, const char *uri)
{
- if (!input_stream_open(is, uri))
+ GError *error = NULL;
+
+ if (!input_stream_open(is, uri, &error)) {
+ if (error != NULL) {
+ g_warning("%s", error->message);
+ g_error_free(error);
+ }
+
return false;
+ }
/* wait for the input stream to become ready; its metadata
will be available then */
@@ -73,9 +81,11 @@ decoder_input_stream_open(struct decoder_control *dc,
decoder_lock_get_command(dc) != DECODE_COMMAND_STOP) {
int ret;
- ret = input_stream_buffer(is);
+ ret = input_stream_buffer(is, &error);
if (ret < 0) {
input_stream_close(is);
+ g_warning("%s", error->message);
+ g_error_free(error);
return false;
}
}
@@ -103,7 +113,7 @@ decoder_stream_decode(const struct decoder_plugin *plugin,
decoder_unlock(decoder->dc);
/* rewind the stream, so each plugin gets a fresh start */
- input_stream_seek(input_stream, 0, SEEK_SET);
+ input_stream_seek(input_stream, 0, SEEK_SET, NULL);
decoder_plugin_stream_decode(plugin, decoder, input_stream);