]> git.nihav.org Git - nihav-encoder.git/commitdiff
use conversion when output parameters are forced
authorKostya Shishkov <kostya.shishkov@gmail.com>
Sun, 12 Jul 2020 08:24:52 +0000 (10:24 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Sun, 12 Jul 2020 08:24:52 +0000 (10:24 +0200)
src/main.rs

index 8d5efd377fd67aa680101adeacd4e6ea267caafe..5c9b8ac936468a1e13d11d84824badc8d1e2e0ca 100644 (file)
@@ -410,6 +410,7 @@ impl Transcoder {
                     return false;
                 }
                 let mut encoder = (enc_create.unwrap())();
+                let forced_out = oopts.enc_params.format != NACodecTypeInfo::None;
                 if oopts.enc_params.format == NACodecTypeInfo::None {
                     oopts.enc_params.format = istr.get_info().get_properties();
                 }
@@ -427,7 +428,7 @@ impl Transcoder {
 //todo check for params mismatch
                 let cvt = match (&oopts.enc_params.format, &ret_eparams.format) {
                         (NACodecTypeInfo::Video(svinfo), NACodecTypeInfo::Video(dvinfo)) => {
-                            if svinfo == dvinfo {
+                            if svinfo == dvinfo && !forced_out {
                                 OutputConvert::None
                             } else {
                                 let ofmt = ScaleInfo { fmt: dvinfo.format, width: dvinfo.width, height: dvinfo.height };