Index: ffmpeg_converter.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ffmpeg_converter/ffmpeg_converter.module,v
retrieving revision 1.36
diff -u -r1.36 ffmpeg_converter.module
--- ffmpeg_converter.module	23 Mar 2009 07:29:43 -0000	1.36
+++ ffmpeg_converter.module	25 Mar 2009 06:51:05 -0000
@@ -1061,22 +1061,26 @@
         $dest_y_calc = round($dest_x / $orig_q);
         // Make sure height is divisible by 2, otherwise ffmpeg freaks out.
         $dest_y_calc &= ~1;
-        $padding1 = floor(($dest_y - $dest_y_calc) / 2);
-        $padding2 = $dest_y - $dest_y_calc - $padding1;
-        $pad = sprintf('-padtop %d -padbottom %d', $padding, $padding);
         $size = $dest_x . 'x' . $dest_y_calc;
+        $padding = $dest_y - $dest_y_calc;
+        $padoptions = '-padtop %d -padbottom %d';
       }
       elseif ($dest_q > $orig_q) {
         // Height is the determining factor.
         $dest_x_calc = round($dest_y * $orig_q);
         // Make sure width is divisible by 2, otherwise ffmpeg freaks out.
         $dest_x_calc &= ~1;
-        $padding1 = round(($dest_x - $dest_x_calc) / 2);
-        $padding2 = $dest_x - $dest_x_calc - $padding1;
-        $pad = sprintf('-padleft %d -padright %d', $padding, $padding);
         $size = $dest_x_calc . 'x' . $dest_y;
+        $padding = $dest_x - $dest_x_calc;
+        $padoptions = '-padleft %d -padright %d';
       }
       
+      // Calculate padding on each side. Each value has to be a multiple of 2.
+      $padding &= ~1;
+      $padding1 = floor($padding / 2);
+      $padding1 &= ~1;
+      $padding2 = $padding - $padding1;
+      $pad = sprintf($padoptions, $padding1, $padding2);
     }
 
     // Save and return the results.
