Skip to content

Commit

Permalink
revised unwrap/expect
Browse files Browse the repository at this point in the history
  • Loading branch information
bwsw committed Sep 6, 2024
1 parent 43fbdb4 commit 92084c5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,15 +335,18 @@ fn handle(params: HandleParams) -> anyhow::Result<()> {
raw_frames
} else {
vec![(
p.data().unwrap().to_vec(),
p.data().unwrap_or(&[]).to_vec(),
video_decoder.width(),
video_decoder.height(),
)]
};

for (raw_frame, width, height) in raw_frames {
let codec = if !decode {
String::from(video_decoder.codec().unwrap().name())
match video_decoder.codec() {
Some(c) => String::from(c.name()),
None => bail!("Unable to get codec name"),
}
} else {
String::from(Id::RAWVIDEO.name())
};
Expand Down Expand Up @@ -434,6 +437,7 @@ fn assign_log_level(ffmpeg_log_level: FFmpegLogLevel) -> Level {

#[pymethods]
impl FFMpegSource {
#[allow(clippy::too_many_arguments)]
#[new]
#[pyo3(signature = (uri, params,
queue_len = 32,
Expand Down

0 comments on commit 92084c5

Please sign in to comment.