mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-12-23 00:26:31 +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
8d0fa62275
commit
8e038572cb
1 changed files with 7 additions and 1 deletions
|
@ -73,7 +73,13 @@ impl Caps {
|
|||
pub fn fixate(&mut self) {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
let ptr = gst_sys::gst_caps_fixate(self.as_mut_ptr());
|
||||
// See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/388
|
||||
assert!(!self.is_any());
|
||||
let ptr = if self.is_empty() {
|
||||
gst_sys::gst_caps_new_empty()
|
||||
} else {
|
||||
gst_sys::gst_caps_fixate(self.as_mut_ptr())
|
||||
};
|
||||
self.replace_ptr(ptr);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue