gstreamer/buffer: Unmap memory in flush() of the Write impl of the buffer cursor

This makes sure that any remaining data is actually written out as part
of the unmapping, which might be necessary depending on the memory type.
This commit is contained in:
Sebastian Dröge 2020-04-07 13:47:04 +03:00
parent 2fbb10ec92
commit 9f96c5e573

View file

@ -218,6 +218,13 @@ macro_rules! define_write_impl(
} }
fn flush(&mut self) -> Result<(), io::Error> { fn flush(&mut self) -> Result<(), io::Error> {
if !self.map_info.memory.is_null() {
unsafe {
gst_sys::gst_memory_unmap(self.map_info.memory, &mut self.map_info);
self.map_info.memory = ptr::null_mut();
}
}
Ok(()) Ok(())
} }
} }