Index: transcode.py
===================================================================
--- transcode.py	(revision 166)
+++ transcode.py	(working copy)
@@ -64,7 +67,7 @@
         #If video is wider than 4:3 add top and bottom padding
         if (ratio > 133):
       
-            endHeight = (720*width)/height
+            endHeight = (720/rwidth)*rheight;
             if endHeight % 2:
                 endHeight -= 1
 
@@ -84,7 +87,7 @@
             return settings
         #If video is taller than 4:3 add left and right padding, this is rare
         else:
-            endWidth = (480*width)/height
+            endWidth = (480/rwidth)*rheight;
             if endWidth % 2:
                 endWidth -= 1
 
