diff options
Diffstat (limited to 'encoders')
-rw-r--r-- | encoders/encoder_lame.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/encoders/encoder_lame.c b/encoders/encoder_lame.c index bf3baff..0836d17 100644 --- a/encoders/encoder_lame.c +++ b/encoders/encoder_lame.c @@ -13,7 +13,7 @@ static gboolean lame_encoder_init(gpointer *data) { } static gssize lame_encoder_encode(gpointer data, GInputStream *input, - GOutputStream *output) { + GOutputStream *output, GError **error) { lame_global_flags *gfp = data; const int inbuf_size = 0x400*8; const int outbuf_size = 0x400*8; @@ -25,7 +25,13 @@ static gssize lame_encoder_encode(gpointer data, GInputStream *input, int ret = lame_encode_buffer_interleaved(gfp, (short*)inbuf, inbuf_read / 4, outbuf, outbuf_size); - return g_output_stream_write(output, outbuf, ret, NULL, NULL); + ret = g_output_stream_write(output, outbuf, ret, NULL, error); + + if(ret == 0) { + *error = g_error_new(encoder_quark(), ENCODER_CODE_DONE, "encoding done"); + } + + return ret; } static void lame_encoder_close(gpointer data) { |