[vlc-devel] [PATCH] oversized subtitles

Hannes Domani ssbssa at yahoo.de
Mon Aug 13 12:18:20 CEST 2007


actually, i think you were just lucky that
i_scale_height and p_fmt->i_height were nearly the
same in your case with the xvideo-module. in this case
i_scale_width would (in the still incorrect formula)
result to almost the same as before (considering that
i_scale_width and i_scale_height are usually the
same). -> the subtitle look correct.
BUT, this are mostly assumptions, since i can't check
this behavior myself.

the wrong formula:
        i_scale_width = i_scale_height *
i_scale_height / p_fmt->i_height;

Domani Hannes

--- Bernie Purcell <b.purcell at adbglobal.com> schrieb:

I've looked into the problem with the subtitles and
think I've worked out why I couldn't reproduce it on
my machine. It appears to be dependant on the video
output driver being used, ie. setting X11 (and
possibly others) produces the bug, and xvideo doesn't.
The reason for this is that when rendering text the
X11 module passes through the real screen dimensions
to be rendered to, along with width and height scale
arguments relative to the original source dimension,
whereas the others pass through the source video's
dimensions and width and scale arguments equating to
1:1. Presumably the difference is due to these other
modules taking care of the final scaling themselves,
but X11 giving us the chance to do it for it.
A straightforward fix is to just use the source video
dimensions all the time, and recalculate the scale as
appropriate. I've already done a patch based on
Hannes' work that does just this and appears to fix
the problem - I'm hoping however that we can improve
on this because I actually like what the X11 module is
By passing in the real screen area to be filled we get
a chance to render at the final resolution, and not
just have our effort distorted by inevitable upscaling
when we switch to full screen. There are a couple of
problems I still need to code around - getting other
subpicture regions to scale properly when one region
in a set takes advantage of this, and getting all the
offsets for placement and cropping to calculate
correctly, but so far it is producing significantly
more crisper text, so I think I'll keep trying. I've
just committed a patch to freetype that assists with
this solution.
In the meantime the suggested solution is for people
to try a different video module if their hardware
supports it.

Yahoo! Clever - Der einfachste Weg, Fragen zu stellen und Wissenswertes mit Anderen zu teilen. www.yahoo.de/clever

vlc-devel mailing list
vlc-devel at videolan.org

More information about the vlc-devel mailing list