diff options
Diffstat (limited to 'encoders/encoder_lame.c')
-rw-r--r-- | encoders/encoder_lame.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/encoders/encoder_lame.c b/encoders/encoder_lame.c index 0836d17..ead8f7c 100644 --- a/encoders/encoder_lame.c +++ b/encoders/encoder_lame.c @@ -34,6 +34,14 @@ static gssize lame_encoder_encode(gpointer data, GInputStream *input, return ret; } +static void lame_encoder_flush(gpointer data, GOutputStream *output, GError **error) { + lame_global_flags *gfp = data; + const int outbuf_size = 7200; + unsigned char outbuf[outbuf_size]; + int size = lame_encode_flush(gfp, outbuf, outbuf_size); + g_output_stream_write(output, outbuf, size, NULL, error); +} + static void lame_encoder_close(gpointer data) { lame_global_flags *gfp = data; lame_close(gfp); @@ -43,5 +51,6 @@ const struct encoder_plugin encoder_lame_encoder = { .name = "lame", .init = lame_encoder_init, .encode = lame_encoder_encode, + .flush = lame_encoder_flush, .close = lame_encoder_close, }; |