diff --git a/gst-plugin/src/streams.rs b/gst-plugin/src/streams.rs index 18337b32..4160efc3 100644 --- a/gst-plugin/src/streams.rs +++ b/gst-plugin/src/streams.rs @@ -210,6 +210,10 @@ impl StreamCollection { unsafe { gst_stream_collection_get_size(self.0) } } + pub fn empty(&self) -> bool { + self.len() == 0 + } + pub fn get_upstream_id(&self) -> &str { extern "C" { fn gst_stream_collection_get_upstream_id(collection: *mut c_void) -> *mut c_char; diff --git a/gst-plugin/src/value.rs b/gst-plugin/src/value.rs index 857f7837..ab6efd42 100644 --- a/gst-plugin/src/value.rs +++ b/gst-plugin/src/value.rs @@ -196,11 +196,7 @@ impl Value { match gvalue.typ { TYPE_BOOLEAN => unsafe { - Some(Value::Bool(if g_value_get_boolean(gvalue as *const GValue) == 0 { - false - } else { - true - })) + Some(Value::Bool(!(g_value_get_boolean(gvalue as *const GValue) == 0))) }, TYPE_INT => unsafe { Some(Value::Int(g_value_get_int(gvalue as *const GValue))) }, TYPE_UINT => unsafe { Some(Value::UInt(g_value_get_uint(gvalue as *const GValue))) },