forked from mirrors/gstreamer-rs
gstreamer-audio: Simplify audio clipping meta test a bit
This commit is contained in:
parent
d05f8cace8
commit
7c19318097
1 changed files with 10 additions and 8 deletions
|
@ -74,6 +74,8 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn test_add_get_meta() {
|
||||
use std::convert::TryInto;
|
||||
|
||||
gst::init().unwrap();
|
||||
|
||||
let mut buffer = gst::Buffer::with_size(1024).unwrap();
|
||||
|
@ -85,24 +87,24 @@ mod tests {
|
|||
gst::format::Default(Some(2)),
|
||||
);
|
||||
assert_eq!(
|
||||
cmeta.get_start(),
|
||||
gst::GenericFormattedValue::Default(gst::format::Default(Some(1)))
|
||||
cmeta.get_start().try_into(),
|
||||
Ok(gst::format::Default(Some(1)))
|
||||
);
|
||||
assert_eq!(
|
||||
cmeta.get_end(),
|
||||
gst::GenericFormattedValue::Default(gst::format::Default(Some(2)))
|
||||
cmeta.get_end().try_into(),
|
||||
Ok(gst::format::Default(Some(2)))
|
||||
);
|
||||
}
|
||||
|
||||
{
|
||||
let cmeta = buffer.get_meta::<AudioClippingMeta>().unwrap();
|
||||
assert_eq!(
|
||||
cmeta.get_start(),
|
||||
gst::GenericFormattedValue::Default(gst::format::Default(Some(1)))
|
||||
cmeta.get_start().try_into(),
|
||||
Ok(gst::format::Default(Some(1)))
|
||||
);
|
||||
assert_eq!(
|
||||
cmeta.get_end(),
|
||||
gst::GenericFormattedValue::Default(gst::format::Default(Some(2)))
|
||||
cmeta.get_end().try_into(),
|
||||
Ok(gst::format::Default(Some(2)))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue