From 6b34324ce1bdc1965904b2692507d63cd8af98cf Mon Sep 17 00:00:00 2001 From: Russell Greene Date: Wed, 13 Nov 2024 00:42:00 -0700 Subject: [PATCH] fix regression --- src/main.rs | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/main.rs b/src/main.rs index b462f44..055687d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1939,20 +1939,24 @@ fn video_filter( }; let transpose_dir = match transform { - Transform::_90 => "clock", - Transform::_180 => "reversal", - Transform::_270 => "cclock", - Transform::Flipped => "hflip", - Transform::Flipped90 => "cclock_flip", - Transform::Flipped180 => "vflip", - Transform::Flipped270 => "clock_flip", - _ => "", - }; - let transpose_filter = if vulkan { - format!("transpose_vulkan=dir={transpose_dir}") - } else { - format!("transpose_vaapi=dir={transpose_dir}") + Transform::_90 => Some("clock"), + Transform::_180 => Some("reversal"), + Transform::_270 => Some("cclock"), + Transform::Flipped => Some("hflip"), + Transform::Flipped90 => Some("cclock_flip"), + Transform::Flipped180 => Some("vflip"), + Transform::Flipped270 => Some("clock_flip"), + _ => None, }; + let transpose_filter = transpose_dir + .map(|transpose_dir| { + if vulkan { + format!("transpose_vulkan=dir={transpose_dir}") + } else { + format!("transpose_vaapi=dir={transpose_dir}") + } + }) + .unwrap_or_default(); // it seems intel's vaapi driver doesn't support transpose in RGB space, so we have to transpose // after the format conversion