]> git.sesse.net Git - vlc/commitdiff
* src/video_output/vout_subpictures.c: modify the scaling factor based on the origina...
authorGildas Bazin <gbazin@videolan.org>
Tue, 21 Sep 2004 20:19:04 +0000 (20:19 +0000)
committerGildas Bazin <gbazin@videolan.org>
Tue, 21 Sep 2004 20:19:04 +0000 (20:19 +0000)
src/video_output/vout_subpictures.c

index a8522d6a71edd22f8a21d3522ac3e45d9b497c2b..400177199144bcc230b492a7f9767e3da4aca596 100644 (file)
@@ -438,7 +438,7 @@ void spu_DestroySubpicture( spu_t *p_spu, subpicture_t *p_subpic )
 void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
                             picture_t *p_pic_dst, picture_t *p_pic_src,
                             subpicture_t *p_subpic,
-                            int i_scale_width, int i_scale_height )
+                            int i_scale_width_orig, int i_scale_height_orig )
 {
     /* Get lock */
     vlc_mutex_lock( &p_spu->subpicture_lock );
@@ -447,6 +447,7 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
     while( p_subpic != NULL && p_subpic->i_status != FREE_SUBPICTURE )
     {
         subpicture_region_t *p_region = p_subpic->p_region;
+        int i_scale_width, i_scale_height;
 
         /* Load the blending module */
         if( !p_spu->p_blend && p_region )
@@ -484,6 +485,18 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
                 module_Need( p_spu->p_text, "text renderer", 0, 0 );
         }
 
+        i_scale_width = i_scale_width_orig;
+        i_scale_height = i_scale_height_orig;
+
+        if( p_subpic->i_original_picture_width ||
+            p_subpic->i_original_picture_height )
+        {
+            i_scale_width = i_scale_width * p_fmt->i_width /
+                p_subpic->i_original_picture_width;
+            i_scale_height = i_scale_height * p_fmt->i_height /
+                p_subpic->i_original_picture_height;
+        }
+
         /* Load the scaling module */
         if( !p_spu->p_scale && (i_scale_width != 1000 ||
             i_scale_height != 1000) )