forked from mirrors/gstreamer-rs
rtp_buffer: buffer() does not need to return an Option
When a RTP buffer is mapped, its buffer field always holds a non-null pointer.
This commit is contained in:
parent
a16c3888e5
commit
d83faa044e
1 changed files with 4 additions and 6 deletions
|
@ -315,15 +315,13 @@ impl<'a, T> RTPBuffer<'a, T> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn buffer(&self) -> Option<&gst::BufferRef> {
|
||||
pub fn buffer(&self) -> &gst::BufferRef {
|
||||
unsafe {
|
||||
let ptr = self.rtp_buffer.buffer;
|
||||
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
Some(gst::BufferRef::from_ptr(ptr))
|
||||
}
|
||||
assert!(!ptr.is_null());
|
||||
|
||||
gst::BufferRef::from_ptr(ptr)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue