audio/audio-buffer: Use correct pointer for the audio buffer plane data

This commit is contained in:
Sebastian Dröge 2020-07-26 18:21:06 +03:00
parent 4f5b2f5060
commit f8301ea9ce

View file

@ -118,7 +118,7 @@ impl<T> AudioBuffer<T> {
unsafe {
Ok(slice::from_raw_parts(
self.audio_buffer.planes.add(plane as usize) as *const u8,
(*self.audio_buffer.planes.add(plane as usize)) as *const u8,
self.plane_size(),
))
}
@ -227,7 +227,7 @@ impl AudioBuffer<Writable> {
unsafe {
Ok(slice::from_raw_parts_mut(
self.audio_buffer.planes.add(plane as usize) as *mut u8,
(*self.audio_buffer.planes.add(plane as usize)) as *mut u8,
self.plane_size(),
))
}
@ -348,7 +348,7 @@ impl<T> AudioBufferRef<T> {
unsafe {
Ok(slice::from_raw_parts(
self.audio_buffer.planes.add(plane as usize) as *const u8,
(*self.audio_buffer.planes.add(plane as usize)) as *const u8,
self.plane_size(),
))
}
@ -479,7 +479,7 @@ impl<'a> AudioBufferRef<&'a mut gst::BufferRef> {
unsafe {
Ok(slice::from_raw_parts_mut(
self.audio_buffer.planes.add(plane as usize) as *mut u8,
(*self.audio_buffer.planes.add(plane as usize)) as *mut u8,
self.plane_size(),
))
}