summaryrefslogtreecommitdiff
path: root/mp3lame.rs
diff options
context:
space:
mode:
authorDavid Barksdale <amatus@amatus.name>2013-09-30 21:33:49 -0500
committerDavid Barksdale <amatus@amatus.name>2013-09-30 21:33:49 -0500
commit692a845e55fc7c07ef3681525885a07a2c3fc749 (patch)
treeabc39514efbcd636616c76fed15363ac67067f5c /mp3lame.rs
parent0e7aecc0fba231f4efc4f16e71f8d1b3952660ff (diff)
Added output MP3 file writing.
Diffstat (limited to 'mp3lame.rs')
-rw-r--r--mp3lame.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/mp3lame.rs b/mp3lame.rs
index 1cfb0c6..a459422 100644
--- a/mp3lame.rs
+++ b/mp3lame.rs
@@ -118,6 +118,20 @@ impl LameContext {
mp3buf
}
}
+ #[fixed_stack_segment]
+ pub fn encode_flush_nogap(&self) -> ~[u8] {
+ unsafe {
+ let mut mp3buf: ~[u8] = vec::with_capacity(7200);
+ let length = lame_encode_flush_nogap(self.gfp,
+ vec::raw::to_mut_ptr(mp3buf) as *c_uchar,
+ 7200);
+ if length < 0 {
+ return ~[];
+ }
+ vec::raw::set_len(&mut mp3buf, length as uint);
+ mp3buf
+ }
+ }
}
impl Drop for LameContext {