Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions mp4parse/tests/public.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ fn public_api() {
// track.data part
assert_eq!(match v.codec_specific {
mp4::VideoCodecSpecific::AVCConfig(v) => {
assert!(v.len() > 0);
assert!(!v.is_empty());
"AVC"
}
mp4::VideoCodecSpecific::VPxConfig(vpx) => {
// We don't enter in here, we just check if fields are public.
assert!(vpx.bit_depth > 0);
assert!(vpx.color_space > 0);
assert!(vpx.chroma_subsampling > 0);
assert!(vpx.codec_init.len() > 0);
assert!(!vpx.codec_init.is_empty());
"VPx"
}
}, "AVC");
Expand Down Expand Up @@ -82,7 +82,7 @@ fn public_api() {
}
mp4::AudioCodecSpecific::FLACSpecificBox(flac) => {
// STREAMINFO block must be present and first.
assert!(flac.blocks.len() > 0);
assert!(!flac.blocks.is_empty());
assert_eq!(flac.blocks[0].block_type, 0);
assert_eq!(flac.blocks[0].data.len(), 34);
"FLAC"
Expand Down Expand Up @@ -201,7 +201,7 @@ fn public_video_cenc() {
for kid_id in pssh.kid {
assert_eq!(kid_id, kid);
}
assert_eq!(pssh.data.len(), 0);
assert!(pssh.data.is_empty());
assert_eq!(pssh.box_content, pssh_box);
}
}
4 changes: 2 additions & 2 deletions mp4parse_capi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -991,8 +991,8 @@ fn create_sample_table(track: &Track, track_offset_time: i64) -> Option<Vec<mp4p

let iter = sort_table.iter();
for i in 0 .. (iter.len() - 1) {
let current_index = sort_table[i] as usize;
let peek_index = sort_table[i + 1] as usize;
let current_index = sort_table[i];
let peek_index = sort_table[i + 1];
let next_start_composition_time = sample_table[peek_index].start_composition;
let sample = &mut sample_table[current_index];
sample.end_composition = next_start_composition_time;
Expand Down