We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8758450 commit 320184eCopy full SHA for 320184e
crates/enc-ffmpeg/src/video/h264.rs
@@ -86,13 +86,13 @@ impl H264EncoderBuilder {
86
output_height = input_config.height;
87
}
88
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
95
- };
+ let encoder_supports_input_format = codec
+ .video()
+ .ok()
+ .and_then(|codec_video| codec_video.formats())
+ .map_or(false, |mut formats| {
+ formats.any(|f| f == input_config.pixel_format)
+ });
96
97
let mut needs_pixel_conversion = false;
98
0 commit comments