mirror of
https://github.com/encounter/rust-ffmpeg.git
synced 2026-07-10 21:18:39 -07:00
feat(format/context): add flush function for frag_custom
This commit is contained in:
@@ -91,6 +91,15 @@ impl Output {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn flush(&mut self) -> Result<(), Error> {
|
||||
unsafe {
|
||||
match av_write_frame(self.as_mut_ptr(), ptr::null_mut()) {
|
||||
e if e < 0 => Err(Error::from(e)),
|
||||
_ => Ok(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_stream(&mut self) -> Result<StreamMut<'_>, Error> {
|
||||
unsafe {
|
||||
let ptr = avformat_new_stream(self.as_mut_ptr(), ptr::null());
|
||||
|
||||
Reference in New Issue
Block a user