format/context/input: implement pause() and play()

This commit is contained in:
lummax 2015-10-02 23:02:20 +02:00 committed by meh
parent e7cd9fd94f
commit 5a07671b92

View File

@ -97,6 +97,24 @@ impl Input {
pub fn packets(&mut self) -> PacketIter { pub fn packets(&mut self) -> PacketIter {
PacketIter::new(self) 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 { impl Deref for Input {