mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-25 11:01:10 +00:00
sdp: Fix SDPMedia constructor, it can't possibly fail
This commit is contained in:
parent
43a7eb8642
commit
83a4529927
1 changed files with 3 additions and 6 deletions
|
@ -40,15 +40,12 @@ glib_wrapper! {
|
|||
}
|
||||
|
||||
impl SDPMedia {
|
||||
pub fn new() -> Result<Self, ()> {
|
||||
pub fn new() -> Self {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
let mut media = ptr::null_mut();
|
||||
let result = ffi::gst_sdp_media_new(&mut media);
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(from_glib_full(media)),
|
||||
_ => Err(()),
|
||||
}
|
||||
ffi::gst_sdp_media_new(&mut media);
|
||||
from_glib_full(media)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue