From 8b4693d04c1960f7d18e6a255c3bd61b0eee180b Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Wed, 21 Jun 2017 01:42:22 +0300 Subject: [PATCH] frame/video: get linesize through self.stride() --- src/util/frame/video.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util/frame/video.rs b/src/util/frame/video.rs index f5891e8..7117a80 100644 --- a/src/util/frame/video.rs +++ b/src/util/frame/video.rs @@ -298,7 +298,7 @@ impl Video { unsafe { slice::from_raw_parts( mem::transmute((*self.as_ptr()).data[index]), - (*self.as_ptr()).linesize[index] as usize * self.plane_height(index) as usize / mem::size_of::()) + self.stride(index) * self.plane_height(index) as usize / mem::size_of::()) } } @@ -315,7 +315,7 @@ impl Video { unsafe { slice::from_raw_parts_mut( mem::transmute((*self.as_mut_ptr()).data[index]), - (*self.as_ptr()).linesize[index] as usize * self.plane_height(index) as usize / mem::size_of::()) + self.stride(index) * self.plane_height(index) as usize / mem::size_of::()) } } @@ -327,7 +327,7 @@ impl Video { unsafe { slice::from_raw_parts((*self.as_ptr()).data[index], - (*self.as_ptr()).linesize[index] as usize * self.plane_height(index) as usize) + self.stride(index) * self.plane_height(index) as usize) } } @@ -339,7 +339,7 @@ impl Video { unsafe { slice::from_raw_parts_mut((*self.as_mut_ptr()).data[index], - (*self.as_ptr()).linesize[index] as usize * self.plane_height(index) as usize) + self.stride(index) * self.plane_height(index) as usize) } } }