*: returning &mut Self from setters was an awful idea
Deref breaks things.
This commit is contained in:
@ -64,20 +64,16 @@ impl Audio {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_channel_layout(&mut self, value: ChannelLayout) -> &mut Self {
|
||||
pub fn set_channel_layout(&mut self, value: ChannelLayout) {
|
||||
unsafe {
|
||||
(*self.as_mut_ptr()).channel_layout = value.bits();
|
||||
}
|
||||
|
||||
self
|
||||
}
|
||||
|
||||
pub fn request_channel_layout(&mut self, value: ChannelLayout) -> &mut Self {
|
||||
pub fn request_channel_layout(&mut self, value: ChannelLayout) {
|
||||
unsafe {
|
||||
(*self.as_mut_ptr()).request_channel_layout = value.bits();
|
||||
}
|
||||
|
||||
self
|
||||
}
|
||||
|
||||
pub fn audio_service(&mut self) -> AudioService {
|
||||
|
@ -84,36 +84,28 @@ impl Video {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_slice_count(&mut self, value: usize) -> &mut Self {
|
||||
pub fn set_slice_count(&mut self, value: usize) {
|
||||
unsafe {
|
||||
(*self.as_mut_ptr()).slice_count = value as c_int;
|
||||
}
|
||||
|
||||
self
|
||||
}
|
||||
|
||||
pub fn set_slice_flags(&mut self, value: slice::Flags) -> &mut Self {
|
||||
pub fn set_slice_flags(&mut self, value: slice::Flags) {
|
||||
unsafe {
|
||||
(*self.as_mut_ptr()).slice_flags = value.bits();
|
||||
}
|
||||
|
||||
self
|
||||
}
|
||||
|
||||
pub fn skip_top(&mut self, value: usize) -> &mut Self {
|
||||
pub fn skip_top(&mut self, value: usize) {
|
||||
unsafe {
|
||||
(*self.as_mut_ptr()).skip_top = value as c_int;
|
||||
}
|
||||
|
||||
self
|
||||
}
|
||||
|
||||
pub fn skip_bottom(&mut self, value: usize) -> &mut Self {
|
||||
pub fn skip_bottom(&mut self, value: usize) {
|
||||
unsafe {
|
||||
(*self.as_mut_ptr()).skip_bottom = value as c_int;
|
||||
}
|
||||
|
||||
self
|
||||
}
|
||||
|
||||
pub fn references(&self) -> usize {
|
||||
@ -122,12 +114,10 @@ impl Video {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_field_order(&mut self, value: FieldOrder) -> &mut Self {
|
||||
pub fn set_field_order(&mut self, value: FieldOrder) {
|
||||
unsafe {
|
||||
(*self.as_mut_ptr()).field_order = value.into();
|
||||
}
|
||||
|
||||
self
|
||||
}
|
||||
|
||||
// intra_matrix
|
||||
|
Reference in New Issue
Block a user