Nullability fix for VideoFormat::to_string() in case Unknown is passed

This commit is contained in:
Sebastian Dröge 2017-12-16 10:58:10 +02:00
parent 0eb32f0483
commit d3b03de9ff

View file

@ -83,6 +83,10 @@ impl ::VideoFormat {
}
pub fn to_string<'a>(&self) -> &'a str {
if *self == ::VideoFormat::Unknown {
return "UNKNOWN";
}
unsafe {
CStr::from_ptr(ffi::gst_video_format_to_string(self.to_glib()))
.to_str()