diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2010-09-05 20:39:32 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2010-09-05 20:39:32 +0200 |
commit | a6e733f5f43ced09a06fe2de569e5d6ab6d63604 (patch) | |
tree | 28088f41db72bffc7fb290b814a97305ed3e018a /decoders | |
parent | e4dedafd25149b200f5c56a992ac57f91ee4f42f (diff) |
Added proper error handling to encoders/decoders.
Diffstat (limited to 'decoders')
-rw-r--r-- | decoders/decoder_mpg123.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/decoders/decoder_mpg123.c b/decoders/decoder_mpg123.c index ea263f5..50391f4 100644 --- a/decoders/decoder_mpg123.c +++ b/decoders/decoder_mpg123.c @@ -30,7 +30,7 @@ static gboolean mpg123_decoder_init(gpointer *data) { } static gssize mpg123_decoder_decode(gpointer data, GInputStream *input, - GOutputStream *output) { + GOutputStream *output, GError **error) { mpg123_handle *handle = data; gssize size; int ret; @@ -43,7 +43,7 @@ static gssize mpg123_decoder_decode(gpointer data, GInputStream *input, if(mpg123_feed(handle, inbuf, inbuf_read) != MPG123_OK) { g_debug("asdfasdf"); - g_warning(mpg123_strerror(handle)); + *error = g_error_new(decoder_quark(), DECODER_CODE_ERROR, mpg123_strerror(handle)); return -1; } @@ -59,7 +59,7 @@ static gssize mpg123_decoder_decode(gpointer data, GInputStream *input, if(ret != MPG123_OK && ret != MPG123_DONE && ret != MPG123_NEW_FORMAT && ret != MPG123_NEED_MORE) { - g_warning(mpg123_plain_strerror(ret)); + *error = g_error_new(decoder_quark(), DECODER_CODE_ERROR, mpg123_plain_strerror(ret)); return -1; } |