Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
amacneil committed Nov 9, 2024
1 parent 5835d9f commit c2a4840
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ pub fn convert_to_annex_b(data: &[u8], codec: CodecType) -> Vec<u8> {
let nal_size =
u32::from_be_bytes([data[pos], data[pos + 1], data[pos + 2], data[pos + 3]]) as usize;

let nal_type = if pos + 4 + 1 <= data.len() {
let nal_type = if pos + 4 < data.len() {
match codec {
CodecType::H264 => data[pos + 4] & 0x1F,
CodecType::H265 => (data[pos + 4] >> 1) & 0x3F,
Expand Down
5 changes: 2 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use clap::Parser;
use ffmpeg_next as ffmpeg;
use mcap::{records::MessageHeader, Channel, Schema, Writer};
use prost::Message;
use prost_types;

pub mod foxglove {
include!(concat!(env!("OUT_DIR"), "/foxglove.rs"));
Expand Down Expand Up @@ -68,8 +67,8 @@ fn main() -> Result<(), Box<dyn Error>> {
let mut frame = ffmpeg::frame::Video::empty();
let first_frame = true;

let mut packet_iter = input.packets();
while let Some((stream, packet)) = packet_iter.next() {
let packet_iter = input.packets();
for (stream, packet) in packet_iter {
if stream.index() != video_stream_index {
continue;
}
Expand Down

0 comments on commit c2a4840

Please sign in to comment.