mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-02-20 12:56:22 +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 {
|
impl SDPMedia {
|
||||||
pub fn new() -> Result<Self, ()> {
|
pub fn new() -> Self {
|
||||||
assert_initialized_main_thread!();
|
assert_initialized_main_thread!();
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut media = ptr::null_mut();
|
let mut media = ptr::null_mut();
|
||||||
let result = ffi::gst_sdp_media_new(&mut media);
|
ffi::gst_sdp_media_new(&mut media);
|
||||||
match result {
|
from_glib_full(media)
|
||||||
ffi::GST_SDP_OK => Ok(from_glib_full(media)),
|
|
||||||
_ => Err(()),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue