From 5a07671b9278aefe4327508d6eb843e9ac911be2 Mon Sep 17 00:00:00 2001 From: lummax Date: Fri, 2 Oct 2015 23:02:20 +0200 Subject: [PATCH] format/context/input: implement `pause()` and `play()` --- src/format/context/input.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/format/context/input.rs b/src/format/context/input.rs index b1b1bad..bfcf3b8 100644 --- a/src/format/context/input.rs +++ b/src/format/context/input.rs @@ -97,6 +97,24 @@ impl Input { pub fn packets(&mut self) -> PacketIter { PacketIter::new(self) } + + pub fn pause(&mut self) -> Result<(), Error> { + unsafe { + match av_read_pause(self.as_mut_ptr()) { + 0 => Ok(()), + e => Err(Error::from(e)), + } + } + } + + pub fn play(&mut self) -> Result<(), Error> { + unsafe { + match av_read_play(self.as_mut_ptr()) { + 0 => Ok(()), + e => Err(Error::from(e)), + } + } + } } impl Deref for Input {