forked from mirrors/gstreamer-rs
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/1220>
This commit is contained in:
parent
2354cd6c4f
commit
bc3e1404d6
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