datetime->ref_count == 0 when using VideoTimeCode
I attempted to attach VideoTimeCode meta to a buffer like in a buffer pad probe:
let datetime = glib::DateTime::new_now_utc();
let video_time_code = gst_video::VideoTimeCode::from_date_time(
gst::Fraction::new(30, 1),
&datetime,
gst_video::VideoTimeCodeFlags::empty(),
0,
).expect("vtc");
gst_video::VideoTimeCodeMeta::add(
buffer.make_mut(),
&video_time_code.try_into().expect("video_time_code")
);
and found that it was outputting a ton of
GLib-CRITICAL **: 21:34:41.068: g_date_time_unref: assertion 'datetime->ref_count > 0' failed
GLib-CRITICAL **: 21:34:41.099: g_date_time_ref: assertion 'datetime->ref_count > 0' failed
suggesting something wrong with how references are counted in this code.
Sorry for not providing a self-contained reproducer here, let me know if you end up having a hard time reproducing and I'll see if I can whip one up.