[vlc-devel] [PATCH] wrong-sized subtitles

Bernie Purcell b.purcell at adbglobal.com
Thu Sep 13 06:10:00 CEST 2007


Hi Hannes,

This patch undoes the font smoothing that I went to some trouble to get 
working - ie. rendering text at native resolution when possible, rather 
than using the video resolution. I really don't want to commit it like 
this.
You submitted an earlier patch that didn't have this problem. I'm still 
prepared to consider that one if it fixes your problem. Could you please 
email me the screenshots you've put on the FTP server as I can't access 
them though.

Bitmap



Hannes Domani <ssbssa at yahoo.de> 
Sent by: vlc-devel-bounces at videolan.org
12/09/2007 08:42 PM
Please respond to
Mailing list for VLC media player developers <vlc-devel at videolan.org>


To
vlc-devel <vlc-devel at videolan.org>
cc

Subject
[vlc-devel] [PATCH] wrong-sized subtitles






Hello

this is my new try to fix the subtitles.

this time i made some screenshots to show what needed
to be fixed (but am not sure if they made it to the
ftp):
ftp://ftp.videolan.org/incoming/shot1.png
ftp://ftp.videolan.org/incoming/shot1-patched.png
ftp://ftp.videolan.org/incoming/shot2.png
ftp://ftp.videolan.org/incoming/shot2-patched.png

regards
Domani Hannes


      Machen Sie Yahoo! zu Ihrer Startseite. Los geht's: 
http://de.yahoo.com/set--- 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 )
                     {
_______________________________________________
vlc-devel mailing list
To unsubscribe or modify your subscription options:
http://mailman.videolan.org/listinfo/vlc-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20070913/6c122b1b/attachment.html>


More information about the vlc-devel mailing list