mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-10-31 22:58:51 +00:00
closedcaption: Don't needlessly create a full-range subslice of a slice
This commit is contained in:
parent
9acacbb320
commit
bb8931c39b
3 changed files with 3 additions and 3 deletions
|
@ -118,7 +118,7 @@ Time Code Rate=30DF\r\n\
|
|||
.unwrap();
|
||||
|
||||
let buf = {
|
||||
let mut buf = gst::Buffer::from_mut_slice(Vec::from(&input[..]));
|
||||
let mut buf = gst::Buffer::from_mut_slice(Vec::from(input));
|
||||
let buf_ref = buf.get_mut().unwrap();
|
||||
gst_video::VideoTimeCodeMeta::add(buf_ref, &tc);
|
||||
buf_ref.set_pts(gst::ClockTime::from_seconds(0));
|
||||
|
|
|
@ -144,7 +144,7 @@ fn test_encode_multiple_packets() {
|
|||
let mut buffers = input2
|
||||
.chunks(2)
|
||||
.map(move |bytes| {
|
||||
let mut buf = gst::Buffer::from_mut_slice(Vec::from(&bytes[..]));
|
||||
let mut buf = gst::Buffer::from_mut_slice(Vec::from(bytes));
|
||||
let buf_ref = buf.get_mut().unwrap();
|
||||
gst_video::VideoTimeCodeMeta::add(buf_ref, &t);
|
||||
t.increment_frame();
|
||||
|
|
|
@ -157,7 +157,7 @@ fn test_timecodes() {
|
|||
let mut checksum = 0u32;
|
||||
let mut expected_timecode = valid_timecodes.pop_front().unwrap();
|
||||
|
||||
let buf = gst::Buffer::from_mut_slice(Vec::from(&data[..]));
|
||||
let buf = gst::Buffer::from_mut_slice(Vec::from(data));
|
||||
assert_eq!(h.push(buf), Ok(gst::FlowSuccess::Ok));
|
||||
while let Some(buf) = h.try_pull() {
|
||||
output_len += buf.get_size();
|
||||
|
|
Loading…
Reference in a new issue