From d3b03de9ffd0c823f9f1ea6d51b3c13e17ebb345 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 16 Dec 2017 10:58:10 +0200 Subject: [PATCH] Nullability fix for VideoFormat::to_string() in case Unknown is passed --- gstreamer-video/src/video_format.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gstreamer-video/src/video_format.rs b/gstreamer-video/src/video_format.rs index 455c2bf5d..7a7a3ce08 100644 --- a/gstreamer-video/src/video_format.rs +++ b/gstreamer-video/src/video_format.rs @@ -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()