From ca999c82a9d83b065ff2043bac5ccae19031f5cf Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 24 Mar 2013 13:37:10 +0000 Subject: [PATCH] * 1080p/720p/etc values are defined now by height as well as width --- .../net/sourceforge/filebot/format/MediaBindingBean.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/net/sourceforge/filebot/format/MediaBindingBean.java b/source/net/sourceforge/filebot/format/MediaBindingBean.java index 4e0b0741..935dd048 100644 --- a/source/net/sourceforge/filebot/format/MediaBindingBean.java +++ b/source/net/sourceforge/filebot/format/MediaBindingBean.java @@ -257,22 +257,22 @@ public class MediaBindingBean { @Define("vf") public String getVideoFormat() { + int width = Integer.parseInt(getMediaInfo(StreamKind.Video, 0, "Width")); int height = Integer.parseInt(getMediaInfo(StreamKind.Video, 0, "Height")); int ns = 0; + int[] ws = new int[] { 1920, 1280, 720, 360, 240, 120 }; int[] hs = new int[] { 1080, 720, 480, 360, 240, 120 }; - for (int i = 0; i < hs.length - 1; i++) { - if (height > hs[i + 1]) { + for (int i = 0; i < ws.length - 1; i++) { + if (width > ws[i + 1] && height > hs[i + 1]) { ns = hs[i]; break; } } - if (ns > 0) { // e.g. 720p, nobody actually wants files to be tagged as interlaced, e.g. 720i return String.format("%dp", ns); } - return null; // video too small }