video: Assert if caption data passed when adding caption metas is empty

It will cause a critical warning otherwise.
This commit is contained in:
Sebastian Dröge 2020-04-22 21:42:39 +03:00
parent 605898277f
commit 215dbe53c6

View file

@ -204,6 +204,7 @@ impl VideoCaptionMeta {
caption_type: ::VideoCaptionType,
data: &[u8],
) -> gst::MetaRefMut<'a, Self, gst::meta::Standalone> {
assert!(!data.is_empty());
unsafe {
let meta = gst_video_sys::gst_buffer_add_video_caption_meta(
buffer.as_mut_ptr(),