diff --git a/gst-plugin/src/caps.rs b/gst-plugin/src/caps.rs index 76df49e5..118bfccc 100644 --- a/gst-plugin/src/caps.rs +++ b/gst-plugin/src/caps.rs @@ -108,7 +108,7 @@ impl Caps { unsafe { let ptr = gst_caps_to_string(self.0); - let s = CStr::from_ptr(ptr).to_string_lossy().into_owned(); + let s = CStr::from_ptr(ptr).to_str().unwrap().into(); g_free(ptr); s diff --git a/gst-plugin/src/streams.rs b/gst-plugin/src/streams.rs index edbfadbc..80ae2416 100644 --- a/gst-plugin/src/streams.rs +++ b/gst-plugin/src/streams.rs @@ -102,8 +102,9 @@ impl Stream { unsafe { CStr::from_ptr(gst_stream_get_stream_id(self.0)) - .to_string_lossy() - .into_owned() + .to_str() + .unwrap() + .into() } } @@ -215,8 +216,9 @@ impl StreamCollection { unsafe { CStr::from_ptr(gst_stream_collection_get_upstream_id(self.0)) - .to_string_lossy() - .into_owned() + .to_str() + .unwrap() + .into() } } diff --git a/gst-plugin/src/tags.rs b/gst-plugin/src/tags.rs index e962fb3c..7dc8b063 100644 --- a/gst-plugin/src/tags.rs +++ b/gst-plugin/src/tags.rs @@ -138,7 +138,7 @@ impl TagList { unsafe { let ptr = gst_tag_list_to_string(self.0); - let s = CStr::from_ptr(ptr).to_string_lossy().into_owned(); + let s = CStr::from_ptr(ptr).to_str().unwrap().into(); g_free(ptr); s