Skip to content

Commit 320184e

Browse files
committed
build fix
1 parent 8758450 commit 320184e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

crates/enc-ffmpeg/src/video/h264.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ impl H264EncoderBuilder {
8686
output_height = input_config.height;
8787
}
8888

89-
let encoder_supports_input_format = match codec.video() {
90-
Some(codec_video) => match codec_video.formats() {
91-
Some(mut formats) => formats.any(|f| f == input_config.pixel_format),
92-
None => false,
93-
},
94-
None => false,
95-
};
89+
let encoder_supports_input_format = codec
90+
.video()
91+
.ok()
92+
.and_then(|codec_video| codec_video.formats())
93+
.map_or(false, |mut formats| {
94+
formats.any(|f| f == input_config.pixel_format)
95+
});
9696

9797
let mut needs_pixel_conversion = false;
9898

0 commit comments

Comments
 (0)