From f1ccd4e69641dbd2be98e3ef38e670b592a103c1 Mon Sep 17 00:00:00 2001 From: Zhiming Wang Date: Mon, 3 Aug 2020 18:49:14 +0800 Subject: [PATCH] filter::Source: add close method Expose av_buffersrc_close. --- src/filter/context/source.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/filter/context/source.rs b/src/filter/context/source.rs index 58ac781..23ec365 100644 --- a/src/filter/context/source.rs +++ b/src/filter/context/source.rs @@ -31,4 +31,13 @@ impl<'a> Source<'a> { pub fn flush(&mut self) -> Result<(), Error> { unsafe { self.add(&Frame::wrap(ptr::null_mut())) } } + + pub fn close(&mut self, pts: i64) -> Result<(), Error> { + unsafe { + match av_buffersrc_close(self.ctx.as_mut_ptr(), pts, 0) { + 0 => Ok(()), + e => Err(Error::from(e)), + } + } + } }