mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-26 19:41:09 +00:00
tags: Use to_glib_none() to convert &str to a C string instead of as_ptr()
The latter does not necessarily give us a NUL-terminated string. Fixes https://github.com/sdroege/gstreamer-rs/issues/122
This commit is contained in:
parent
694bcaa697
commit
93b32882ee
1 changed files with 4 additions and 2 deletions
|
@ -193,8 +193,10 @@ impl TagListRef {
|
|||
unsafe {
|
||||
let v = value.to_send_value();
|
||||
|
||||
let tag_name = tag_name.to_glib_none();
|
||||
|
||||
let tag_type: glib::Type = from_glib(
|
||||
ffi::gst_tag_get_type(tag_name.as_ptr() as *const i8)
|
||||
ffi::gst_tag_get_type(tag_name.0)
|
||||
);
|
||||
if tag_type != v.type_() {
|
||||
return Err(TagError::TypeMismatch)
|
||||
|
@ -203,7 +205,7 @@ impl TagListRef {
|
|||
ffi::gst_tag_list_add_value(
|
||||
self.as_mut_ptr(),
|
||||
mode.to_glib(),
|
||||
tag_name.to_glib_none().0,
|
||||
tag_name.0,
|
||||
v.to_glib_none().0,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue