*: returning &mut Self from setters was an awful idea

Deref breaks things.
This commit is contained in:
meh
2015-10-04 03:21:52 +02:00
parent 0764c597e4
commit 132c514e3f
16 changed files with 151 additions and 279 deletions

View File

@ -83,12 +83,10 @@ impl Output {
}
}
pub fn set_metadata(&mut self, dictionary: Dictionary) -> &mut Self {
pub fn set_metadata(&mut self, dictionary: Dictionary) {
unsafe {
(*self.as_mut_ptr()).metadata = dictionary.disown();
}
self
}
}

View File

@ -29,20 +29,16 @@ impl<'a> StreamMut<'a> {
}
impl<'a> StreamMut<'a> {
pub fn set_time_base<R: Into<Rational>>(&mut self, value: R) -> &mut Self {
pub fn set_time_base<R: Into<Rational>>(&mut self, value: R) {
unsafe {
(*self.as_mut_ptr()).time_base = value.into().into();
}
self
}
pub fn set_rate<R: Into<Rational>>(&mut self, value: R) -> &mut Self {
pub fn set_rate<R: Into<Rational>>(&mut self, value: R) {
unsafe {
av_stream_set_r_frame_rate(self.as_mut_ptr(), value.into().into());
}
self
}
}