Index: video_filter.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/video_filter/video_filter.module,v
retrieving revision 1.12.2.4
diff -u -p -r1.12.2.4 video_filter.module
--- video_filter.module	28 Mar 2009 21:53:10 -0000	1.12.2.4
+++ video_filter.module	20 Apr 2009 20:37:43 -0000
@@ -124,13 +124,25 @@ function video_filter_process($text, $fo
 
         // Resize within width and height to given ratio
         if ($video['codec']['ratio']) {
-          if ($video['width'] * $video['codec']['ratio'] > $video['height']) {
-            $video['width'] = round($video['height'] * $video['codec']['ratio']);
-            $video['height'] = round($video['width'] / $video['codec']['ratio']);
+          if (variable_get('video_filter_priority_'.$format, 'height') == 'height') {
+            if ($video['width'] * $video['codec']['ratio'] > $video['height']) {
+              $video['width'] = round($video['height'] * $video['codec']['ratio']);
+              $video['height'] = round($video['width'] / $video['codec']['ratio']);
+            }
+            else {
+              $video['height'] = round($video['width'] / $video['codec']['ratio']);
+              $video['width'] = round($video['height'] * $video['codec']['ratio']);
+            }
           }
           else {
-            $video['height'] = round($video['width'] / $video['codec']['ratio']);
-            $video['width'] = round($video['height'] * $video['codec']['ratio']);
+            if ($video['height'] * $video['codec']['ratio'] > $video['width']) {
+              $video['height'] = round($video['width'] / $video['codec']['ratio']);
+              $video['width'] = round($video['height'] * $video['codec']['ratio']);
+            }
+            else {
+              $video['width'] = round($video['height'] * $video['codec']['ratio']);
+              $video['height'] = round($video['width'] / $video['codec']['ratio']);
+            }
           }
         }
 
@@ -179,6 +191,16 @@ function video_filter_settings($format) 
       1 => t('Yes'),
     ),
   );
+  $form['video_filter']['video_filter_priority_'.$format] = array(
+    '#type' => 'radios',
+    '#title' => t('Default priority setting'),
+    '#description' => t('Should height or width take priority when videos are re-sized to fit?'),
+    '#default_value' => variable_get('video_filter_priority_'.$format, 'height'),
+    '#options' => array(
+      height => t('Height'),
+      width => t('Width'),
+    ),
+  );
 
   return $form;
 }
