diff --git a/src/format/chapter/chapter.rs b/src/format/chapter/chapter.rs index db3d9d2..05c88a7 100644 --- a/src/format/chapter/chapter.rs +++ b/src/format/chapter/chapter.rs @@ -13,9 +13,7 @@ impl<'a> Chapter<'a> { } pub unsafe fn as_ptr(&self) -> *const AVChapter { - *(*self.context.as_ptr()) - .chapters - .offset(self.index as isize) + *(*self.context.as_ptr()).chapters.add(self.index) } } diff --git a/src/format/chapter/chapter_mut.rs b/src/format/chapter/chapter_mut.rs index 6ab8174..33b7d69 100644 --- a/src/format/chapter/chapter_mut.rs +++ b/src/format/chapter/chapter_mut.rs @@ -23,9 +23,7 @@ impl<'a> ChapterMut<'a> { } pub unsafe fn as_mut_ptr(&mut self) -> *mut AVChapter { - *(*self.context.as_mut_ptr()) - .chapters - .offset(self.index as isize) + *(*self.context.as_mut_ptr()).chapters.add(self.index) } } diff --git a/src/format/stream/stream.rs b/src/format/stream/stream.rs index 6e229ba..ef36682 100644 --- a/src/format/stream/stream.rs +++ b/src/format/stream/stream.rs @@ -20,7 +20,7 @@ impl<'a> Stream<'a> { } pub unsafe fn as_ptr(&self) -> *const AVStream { - *(*self.context.as_ptr()).streams.offset(self.index as isize) + *(*self.context.as_ptr()).streams.add(self.index) } } diff --git a/src/format/stream/stream_mut.rs b/src/format/stream/stream_mut.rs index 6e32cd4..f04be91 100644 --- a/src/format/stream/stream_mut.rs +++ b/src/format/stream/stream_mut.rs @@ -21,9 +21,7 @@ impl<'a> StreamMut<'a> { } pub unsafe fn as_mut_ptr(&mut self) -> *mut AVStream { - *(*self.context.as_mut_ptr()) - .streams - .offset(self.index as isize) + *(*self.context.as_mut_ptr()).streams.add(self.index) } } diff --git a/src/util/format/sample.rs b/src/util/format/sample.rs index 4cfebb4..48b5334 100644 --- a/src/util/format/sample.rs +++ b/src/util/format/sample.rs @@ -190,7 +190,7 @@ impl Index for Buffer { panic!("out of bounds"); } - unsafe { slice::from_raw_parts(*self.buffer.offset(index as isize), self.size as usize) } + unsafe { slice::from_raw_parts(*self.buffer.add(index), self.size as usize) } } }