mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-26 11:31:06 +00:00
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:
parent
2fbb10ec92
commit
9f96c5e573
1 changed files with 7 additions and 0 deletions
|
@ -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(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue