diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2010-12-25 23:33:46 +0100 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2010-12-25 23:33:46 +0100 |
commit | 3a23129ac5110d72040692b229554babc2aa2a99 (patch) | |
tree | 81a74d9d92ec6f474f038f0089d69ffb6b2ecbc6 /encoders | |
parent | 03d091e6150a17a71f1f8e6440ed5ea9aaa1311d (diff) |
Added encoder_flush() to flush encoder buffers.old
Diffstat (limited to 'encoders')
-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, }; |