Always free video frames with NDIlib_recv_free_video_v2() after last use

And not potentially before or not at all.
This commit is contained in:
Sebastian Dröge 2019-07-09 19:21:57 +03:00
parent 7b8070c55d
commit b41d5839d4

View file

@ -476,7 +476,6 @@ impl BaseSrcImpl for NdiVideoSrc {
}
if time >= (video_frame.timestamp as u64) {
NDIlib_recv_free_video_v2(pNDI_recv, &video_frame);
gst_debug!(self.cat, obj: element, "Frame timestamp ({:?}) is lower than received in the first frame from NDI ({:?}), so skiping...", (video_frame.timestamp as u64), time);
} else {
skip_frame = false;
@ -526,6 +525,7 @@ impl BaseSrcImpl for NdiVideoSrc {
}
gst_log!(self.cat, obj: element, "Produced buffer {:?}", buffer);
NDIlib_recv_free_video_v2(pNDI_recv, &video_frame);
Ok(buffer)
}