mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-12-23 00:26:31 +00:00
video: Don't forget to unmap the VideoFrame
when converting into a gst::Buffer
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1219>
This commit is contained in:
parent
2ac85cd8de
commit
6ffb1db482
1 changed files with 6 additions and 2 deletions
|
@ -46,8 +46,12 @@ impl<T> VideoFrame<T> {
|
|||
|
||||
#[inline]
|
||||
pub fn into_buffer(self) -> gst::Buffer {
|
||||
let s = mem::ManuallyDrop::new(self);
|
||||
unsafe { ptr::read(&s.buffer) }
|
||||
unsafe {
|
||||
let mut s = mem::ManuallyDrop::new(self);
|
||||
let buffer = ptr::read(&s.buffer);
|
||||
ffi::gst_video_frame_unmap(&mut s.frame);
|
||||
buffer
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_video_frame_copy")]
|
||||
|
|
Loading…
Reference in a new issue