mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-01-09 08:45:27 +00:00
gstreamer/caps: Assert on ANY caps in fixate() and work around bug in handling EMPTY caps
See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/388
This commit is contained in:
parent
671605d8ac
commit
2599acc681
1 changed files with 10 additions and 1 deletions
|
@ -72,7 +72,16 @@ impl Caps {
|
|||
|
||||
pub fn fixate(caps: Self) -> Self {
|
||||
skip_assert_initialized!();
|
||||
unsafe { from_glib_full(gst_sys::gst_caps_fixate(caps.into_ptr())) }
|
||||
unsafe {
|
||||
// See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/388
|
||||
assert!(!caps.is_any());
|
||||
let ptr = if caps.is_empty() {
|
||||
gst_sys::gst_caps_new_empty()
|
||||
} else {
|
||||
gst_sys::gst_caps_fixate(caps.into_ptr())
|
||||
};
|
||||
from_glib_full(ptr)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn merge(caps: Self, other: Self) -> Self {
|
||||
|
|
Loading…
Reference in a new issue