--- src/video_output/vout_subpictures.c	Mon Sep 10 17:50:01 2007
+++ src/video_output/vout_subpictures.c	Mon Sep 10 18:16:14 2007
@@ -509,9 +509,6 @@
                             subpicture_t *p_subpic,
                             int i_scale_width_orig, int i_scale_height_orig )
 {
-    int i_source_video_width  = p_fmt->i_width  * 1000 / i_scale_width_orig;
-    int i_source_video_height = p_fmt->i_height * 1000 / i_scale_height_orig;
-
     /* Get lock */
     vlc_mutex_lock( &p_spu->subpicture_lock );
 
@@ -610,25 +607,6 @@
         pi_scale_width[ SCALE_TEXT ]     = p_fmt->i_width  * 1000 / p_spu->p_text->fmt_out.video.i_width;
         pi_scale_height[ SCALE_TEXT ]    = p_fmt->i_height * 1000 / p_spu->p_text->fmt_out.video.i_height;
 
-        for( k=0; k< SCALE_SIZE ; k++ )
-        {
-            if( (p_subpic->i_original_picture_height > 0) &&
-                (p_subpic->i_original_picture_width  > 0) )
-            {
-                pi_scale_width[ k ]  = pi_scale_width[ k ]  * i_source_video_width /
-                                 p_subpic->i_original_picture_width;
-                pi_scale_height[ k ] = pi_scale_height[ k ] * i_source_video_height /
-                                 p_subpic->i_original_picture_height;
-            }
-            else if( p_subpic->i_original_picture_height > 0 )
-            {
-                pi_scale_height[ k ] = pi_scale_height[ k ] * i_source_video_height /
-                                 p_subpic->i_original_picture_height;
-                pi_scale_width[ k ]  = pi_scale_width[ k ]  * i_source_video_height /
-                                 p_subpic->i_original_picture_height;
-            }
-        }
-
         /* Set default subpicture aspect ratio */
         if( p_region && p_region->fmt.i_aspect &&
             (!p_region->fmt.i_sar_num || !p_region->fmt.i_sar_den) )
@@ -696,6 +674,7 @@
                 if( p_spu->p_text && p_spu->p_text->p_module )
                 {
                     vlc_value_t  val;
+                    int i_scale;
 
                     /* Setup 3 variables which can be used to render
                      * time-dependent text (and effects). The first indicates
@@ -729,8 +708,11 @@
                     var_SetBool( p_spu->p_text, "text-rerender", VLC_FALSE );
 
                     var_Create( p_spu->p_text, "scale", VLC_VAR_INTEGER );
-                    var_SetInteger( p_spu->p_text, "scale",
-                              __MIN(i_scale_width_orig, i_scale_height_orig) );
+                    i_scale = __MIN( i_scale_width_orig, i_scale_height_orig );
+                    if( p_subpic->i_original_picture_height > 0 )
+                        i_scale = i_scale * p_fmt->i_height /
+                            p_subpic->i_original_picture_height;
+                    var_SetInteger( p_spu->p_text, "scale", i_scale );
 
                     if( p_spu->p_text->pf_render_html && p_region->psz_html )
                     {
